实现:
PhoneWindowManager.java
else if (attrs.type == TYPE_INPUT_METHOD) {
pf.left = df.left = of.left = cf.left = vf.left = 550;//mDockLeft; pf.top = df.top = of.top = cf.top = vf.top = 180;//mDockTop;
pf.right = df.right = of.right = cf.right = vf.right = 1020;//mDockRight;
pf.bottom = df.bottom = of.bottom = 400;//mUnrestrictedScreenTop + mUnrestrictedScreenHe
<pre name="code" class="html">cf.bottom = vf.bottom = 490;//mStableBottom;
//attrs.gravity = Gravity.BOTTOM;
/**
* Global environment configurations for showing soft keyboard and candidate
* view. All original dimension values are defined in float, and the real size
* is calculated from the float values of and screen size. In this way, this
* input method can work even when screen size is changed.
*/
public class Environment {
public void onConfigurationChanged(Configuration newConfig, Context context) {
if (mConfig.orientation != newConfig.orientation) {
WindowManager wm = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display d = wm.getDefaultDisplay();
// mScreenWidth = d.getWidth();
mScreenWidth = 500;
mScreenHeight = d.getHeight();