public class SoftInputWindow extends Dialog
Modifier and Type | Class and Description |
---|---|
static interface |
SoftInputWindow.Callback |
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
mCancelable
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
Constructor and Description |
---|
SoftInputWindow(Context context,
String name,
int theme,
SoftInputWindow.Callback callback,
KeyEvent.Callback keyEventCallback,
KeyEvent.DispatcherState dispatcherState,
int windowType,
int gravity,
boolean takesFocus)
Create a SoftInputWindow that uses a custom style.
|
Modifier and Type | Method and Description |
---|---|
boolean |
dispatchTouchEvent(MotionEvent ev)
Called to process touch screen events.
|
int |
getGravity() |
void |
onBackPressed()
Called when the dialog has detected the user's press of the back
key.
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
A key was pressed down.
|
boolean |
onKeyLongPress(int keyCode,
KeyEvent event)
Default implementation of
KeyEvent.Callback.onKeyLongPress() : always returns false (doesn't handle
the event). |
boolean |
onKeyMultiple(int keyCode,
int count,
KeyEvent event)
Default implementation of
KeyEvent.Callback.onKeyMultiple() : always returns false (doesn't handle
the event). |
boolean |
onKeyUp(int keyCode,
KeyEvent event)
A key was released.
|
void |
onWindowFocusChanged(boolean hasFocus)
This hook is called whenever the window focus changes.
|
void |
setGravity(int gravity)
Set which boundary of the screen the DockWindow sticks to.
|
void |
setToken(IBinder token) |
addContentView, cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyShortcut, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowDismissed, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onProvideKeyboardShortcuts
public SoftInputWindow(Context context, String name, int theme, SoftInputWindow.Callback callback, KeyEvent.Callback keyEventCallback, KeyEvent.DispatcherState dispatcherState, int windowType, int gravity, boolean takesFocus)
context
- The Context in which the DockWindow should run. In
particular, it uses the window manager and theme from this context
to present its UI.theme
- A style resource describing the theme to use for the window.
See Style
and Theme Resources for more information about defining and
using styles. This theme is applied on top of the current theme in
context. If 0, the default dialog theme will be used.public void setToken(IBinder token)
public void onWindowFocusChanged(boolean hasFocus)
Window.Callback
View.onWindowFocusChangedNotLocked(boolean)
for more information.onWindowFocusChanged
in interface Window.Callback
onWindowFocusChanged
in class Dialog
hasFocus
- Whether the window now has focus.public boolean dispatchTouchEvent(MotionEvent ev)
Dialog
dispatchTouchEvent
in interface Window.Callback
dispatchTouchEvent
in class Dialog
ev
- The touch screen event.public void setGravity(int gravity)
gravity
- The boundary of the screen to stick. See {#link
android.view.Gravity.LEFT}, {#link android.view.Gravity.TOP},
{#link android.view.Gravity.BOTTOM}, {#link
android.view.Gravity.RIGHT}.public int getGravity()
public boolean onKeyDown(int keyCode, KeyEvent event)
Dialog
If the focused view didn't want this event, this method is called.
The default implementation consumed the KEYCODE_BACK to later
handle it in Dialog.onKeyUp(int, android.view.KeyEvent)
.
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class Dialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.Dialog.onKeyUp(int, android.view.KeyEvent)
,
KeyEvent
public boolean onKeyLongPress(int keyCode, KeyEvent event)
Dialog
KeyEvent.Callback.onKeyLongPress()
: always returns false (doesn't handle
the event).onKeyLongPress
in interface KeyEvent.Callback
onKeyLongPress
in class Dialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.public boolean onKeyUp(int keyCode, KeyEvent event)
Dialog
The default implementation handles KEYCODE_BACK to close the dialog.
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class Dialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.Dialog.onKeyDown(int, android.view.KeyEvent)
,
KeyEvent
public boolean onKeyMultiple(int keyCode, int count, KeyEvent event)
Dialog
KeyEvent.Callback.onKeyMultiple()
: always returns false (doesn't handle
the event).onKeyMultiple
in interface KeyEvent.Callback
onKeyMultiple
in class Dialog
keyCode
- The value in event.getKeyCode().count
- Number of pairs as returned by event.getRepeatCount().event
- Description of the key event.public void onBackPressed()
Dialog
onBackPressed
in class Dialog