public class WindowCallbackWrapper extends Object implements Window.Callback
Constructor and Description |
---|
WindowCallbackWrapper(Window.Callback wrapped) |
Modifier and Type | Method and Description |
---|---|
boolean |
dispatchGenericMotionEvent(MotionEvent event)
Called to process generic motion events.
|
boolean |
dispatchKeyEvent(KeyEvent event)
Called to process key events.
|
boolean |
dispatchKeyShortcutEvent(KeyEvent event)
Called to process a key shortcut event.
|
boolean |
dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
Called to process population of
AccessibilityEvent s. |
boolean |
dispatchTouchEvent(MotionEvent event)
Called to process touch screen events.
|
boolean |
dispatchTrackballEvent(MotionEvent event)
Called to process trackball events.
|
void |
onActionModeFinished(ActionMode mode)
Called when an action mode has been finished.
|
void |
onActionModeStarted(ActionMode mode)
Called when an action mode has been started.
|
void |
onAttachedToWindow()
Called when the window has been attached to the window manager.
|
void |
onContentChanged()
This hook is called whenever the content view of the screen changes
(due to a call to
Window.setContentView or
Window.addContentView ). |
boolean |
onCreatePanelMenu(int featureId,
Menu menu)
Initialize the contents of the menu for panel 'featureId'.
|
View |
onCreatePanelView(int featureId)
Instantiate the view to display in the panel for 'featureId'.
|
void |
onDetachedFromWindow()
Called when the window has been attached to the window manager.
|
boolean |
onMenuItemSelected(int featureId,
MenuItem item)
Called when a panel's menu item has been selected by the user.
|
boolean |
onMenuOpened(int featureId,
Menu menu)
Called when a panel's menu is opened by the user.
|
void |
onPanelClosed(int featureId,
Menu menu)
Called when a panel is being closed.
|
boolean |
onPreparePanel(int featureId,
View view,
Menu menu)
Prepare a panel to be displayed.
|
void |
onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data,
Menu menu,
int deviceId)
Called when Keyboard Shortcuts are requested for the current window.
|
boolean |
onSearchRequested()
Called when the user signals the desire to start a search.
|
boolean |
onSearchRequested(SearchEvent searchEvent)
Called when the user signals the desire to start a search.
|
void |
onWindowAttributesChanged(WindowManager.LayoutParams attrs)
This is called whenever the current window attributes change.
|
void |
onWindowFocusChanged(boolean hasFocus)
This hook is called whenever the window focus changes.
|
ActionMode |
onWindowStartingActionMode(ActionMode.Callback callback)
Called when an action mode is being started for this window.
|
ActionMode |
onWindowStartingActionMode(ActionMode.Callback callback,
int type)
Called when an action mode is being started for this window.
|
public WindowCallbackWrapper(Window.Callback wrapped)
public boolean dispatchKeyEvent(KeyEvent event)
Window.Callback
Window.superDispatchKeyEvent(android.view.KeyEvent)
to do the
standard key processing.dispatchKeyEvent
in interface Window.Callback
event
- The key event.public boolean dispatchKeyShortcutEvent(KeyEvent event)
Window.Callback
Window.superDispatchKeyShortcutEvent(android.view.KeyEvent)
to do the
standard key shortcut processing.dispatchKeyShortcutEvent
in interface Window.Callback
event
- The key shortcut event.public boolean dispatchTouchEvent(MotionEvent event)
Window.Callback
Window.superDispatchTouchEvent(android.view.MotionEvent)
to do the
standard touch screen processing.dispatchTouchEvent
in interface Window.Callback
event
- The touch screen event.public boolean dispatchTrackballEvent(MotionEvent event)
Window.Callback
Window.superDispatchTrackballEvent(android.view.MotionEvent)
to do the
standard trackball processing.dispatchTrackballEvent
in interface Window.Callback
event
- The trackball event.public boolean dispatchGenericMotionEvent(MotionEvent event)
Window.Callback
Window.superDispatchGenericMotionEvent(android.view.MotionEvent)
to do the
standard processing.dispatchGenericMotionEvent
in interface Window.Callback
event
- The generic motion event.public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
Window.Callback
AccessibilityEvent
s.dispatchPopulateAccessibilityEvent
in interface Window.Callback
event
- The event.public View onCreatePanelView(int featureId)
Window.Callback
onCreatePanelView
in interface Window.Callback
featureId
- Which panel is being created.Window.Callback.onPreparePanel(int, android.view.View, android.view.Menu)
public boolean onCreatePanelMenu(int featureId, Menu menu)
Window.Callback
You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreatePanelMenu() is called for this feature.
onCreatePanelMenu
in interface Window.Callback
featureId
- The panel being created.menu
- The menu inside the panel.public boolean onPreparePanel(int featureId, View view, Menu menu)
Window.Callback
onPreparePanel
in interface Window.Callback
featureId
- The panel that is being displayed.view
- The View that was returned by onCreatePanelView().menu
- If onCreatePanelView() returned null, this is the Menu
being displayed in the panel.Window.Callback.onCreatePanelView(int)
public boolean onMenuOpened(int featureId, Menu menu)
Window.Callback
onMenuOpened
in interface Window.Callback
featureId
- The panel that the menu is in.menu
- The menu that is opened.public boolean onMenuItemSelected(int featureId, MenuItem item)
Window.Callback
onMenuItemSelected
in interface Window.Callback
featureId
- The panel that the menu is in.item
- The menu item that was selected.public void onWindowAttributesChanged(WindowManager.LayoutParams attrs)
Window.Callback
onWindowAttributesChanged
in interface Window.Callback
public void onContentChanged()
Window.Callback
Window.setContentView
or
Window.addContentView
).onContentChanged
in interface Window.Callback
public void onWindowFocusChanged(boolean hasFocus)
Window.Callback
View.onWindowFocusChangedNotLocked(boolean)
for more information.onWindowFocusChanged
in interface Window.Callback
hasFocus
- Whether the window now has focus.public void onAttachedToWindow()
Window.Callback
View.onAttachedToWindow()
for more information.onAttachedToWindow
in interface Window.Callback
public void onDetachedFromWindow()
Window.Callback
View.onDetachedFromWindow()
for more information.onDetachedFromWindow
in interface Window.Callback
public void onPanelClosed(int featureId, Menu menu)
Window.Callback
onPanelClosed
in interface Window.Callback
featureId
- The panel that is being displayed.menu
- If onCreatePanelView() returned null, this is the Menu
being displayed in the panel.public boolean onSearchRequested(SearchEvent searchEvent)
Window.Callback
onSearchRequested
in interface Window.Callback
searchEvent
- A SearchEvent
describing the signal to
start a search.public boolean onSearchRequested()
Window.Callback
onSearchRequested
in interface Window.Callback
Activity.onSearchRequested()
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback)
Window.Callback
Window.Callback.onWindowStartingActionMode(android.view.ActionMode.Callback, int)
with type ActionMode.TYPE_PRIMARY
.onWindowStartingActionMode
in interface Window.Callback
callback
- Callback to control the lifecycle of this action modepublic ActionMode onWindowStartingActionMode(ActionMode.Callback callback, int type)
Window.Callback
onWindowStartingActionMode
in interface Window.Callback
callback
- Callback to control the lifecycle of this action modetype
- One of ActionMode.TYPE_PRIMARY
or ActionMode.TYPE_FLOATING
.public void onActionModeStarted(ActionMode mode)
Window.Callback
onActionModeStarted
in interface Window.Callback
mode
- The new mode that has just been started.public void onActionModeFinished(ActionMode mode)
Window.Callback
onActionModeFinished
in interface Window.Callback
mode
- The mode that was just finished.public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, Menu menu, int deviceId)
Window.Callback
onProvideKeyboardShortcuts
in interface Window.Callback
data
- The data list to populate with shortcuts.menu
- The current menu, which may be null.deviceId
- The id for the connected device the shortcuts should be provided for.