SoftInputWindowpublic class SoftInputWindow extends android.app.Dialog A SoftInputWindow is a Dialog that is intended to be used for a top-level input
method window. It will be displayed along the edge of the screen, moving
the application user interface away from it so that the focused item is
always visible. |
Constructors Summary |
---|
public SoftInputWindow(android.content.Context context, int theme)Create a DockWindow that uses a custom style.
super(context, theme);
initDockWindow();
|
Methods Summary |
---|
public int | getSize()Get the size of the DockWindow.
WindowManager.LayoutParams lp = getWindow().getAttributes();
if (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM) {
return lp.height;
} else {
return lp.width;
}
| private void | initDockWindow()
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.type = WindowManager.LayoutParams.TYPE_INPUT_METHOD;
lp.setTitle("InputMethod");
lp.gravity = Gravity.BOTTOM;
lp.width = -1;
// Let the input method window's orientation follow sensor based rotation
// Turn this off for now, it is very problematic.
//lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER;
getWindow().setAttributes(lp);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
| public void | setGravity(int gravity)Set which boundary of the screen the DockWindow sticks to.
WindowManager.LayoutParams lp = getWindow().getAttributes();
boolean oldIsVertical = (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM);
lp.gravity = gravity;
boolean newIsVertical = (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM);
if (oldIsVertical != newIsVertical) {
int tmp = lp.width;
lp.width = lp.height;
lp.height = tmp;
getWindow().setAttributes(lp);
}
| public void | setSize(int size)Set the size of the DockWindow.
WindowManager.LayoutParams lp = getWindow().getAttributes();
if (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM) {
lp.width = -1;
lp.height = size;
} else {
lp.width = size;
lp.height = -1;
}
getWindow().setAttributes(lp);
| public void | setToken(android.os.IBinder token)
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.token = token;
getWindow().setAttributes(lp);
|
|