Loading core/java/com/android/internal/inputmethod/InputMethodRoot.java +13 −19 Original line number Diff line number Diff line Loading @@ -17,15 +17,15 @@ package com.android.internal.inputmethod; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; public class InputMethodRoot extends LinearLayout { private final Rect mGuardRect = new Rect(); private final Paint mGuardPaint = new Paint(); private View mNavigationGuard; public InputMethodRoot(Context context) { this(context, null); Loading @@ -37,25 +37,19 @@ public class InputMethodRoot extends LinearLayout { public InputMethodRoot(Context context, AttributeSet attrs, int defStyle) { super(context, attrs); setWillNotDraw(false); mGuardPaint.setColor(context.getResources() .getColor(com.android.internal.R.color.input_method_navigation_guard)); } @Override protected boolean fitSystemWindows(Rect insets) { setPadding(0, 0, 0, insets.bottom); return true; if (mNavigationGuard == null) { mNavigationGuard = findViewById(com.android.internal.R.id.navigationGuard); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); // draw navigation bar guard final int w = getMeasuredWidth(); final int h = getMeasuredHeight(); mGuardRect.set(0, h - getPaddingBottom(), w, h); canvas.drawRect(mGuardRect, mGuardPaint); if (mNavigationGuard == null) { return super.fitSystemWindows(insets); } ViewGroup.LayoutParams lp = mNavigationGuard.getLayoutParams(); lp.height = insets.bottom; mNavigationGuard.setLayoutParams(lp); return true; } } core/res/res/layout/input_method.xml +5 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,9 @@ android:layout_height="wrap_content" android:visibility="gone"> </FrameLayout> <View android:id="@+id/navigationGuard" android:layout_width="match_parent" android:layout_height="0dp" android:background="@+color/input_method_navigation_guard"/> </com.android.internal.inputmethod.InputMethodRoot> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ <java-symbol type="id" name="month" /> <java-symbol type="id" name="month_name" /> <java-symbol type="id" name="name" /> <java-symbol type="id" name="navigationGuard" /> <java-symbol type="id" name="next" /> <java-symbol type="id" name="next_button" /> <java-symbol type="id" name="new_app_action" /> Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -2992,7 +2992,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.top = df.top = of.top = cf.top = vf.top = mDockTop; pf.right = df.right = of.right = cf.right = vf.right = mDockRight; // IM dock windows layout below the nav bar... pf.bottom = df.bottom = of.bottom = mRestrictedScreenTop + mRestrictedScreenHeight; pf.bottom = df.bottom = of.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; // ...with content insets above the nav bar cf.bottom = vf.bottom = mStableBottom; // IM dock windows always go to the bottom of the screen. Loading Loading
core/java/com/android/internal/inputmethod/InputMethodRoot.java +13 −19 Original line number Diff line number Diff line Loading @@ -17,15 +17,15 @@ package com.android.internal.inputmethod; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; public class InputMethodRoot extends LinearLayout { private final Rect mGuardRect = new Rect(); private final Paint mGuardPaint = new Paint(); private View mNavigationGuard; public InputMethodRoot(Context context) { this(context, null); Loading @@ -37,25 +37,19 @@ public class InputMethodRoot extends LinearLayout { public InputMethodRoot(Context context, AttributeSet attrs, int defStyle) { super(context, attrs); setWillNotDraw(false); mGuardPaint.setColor(context.getResources() .getColor(com.android.internal.R.color.input_method_navigation_guard)); } @Override protected boolean fitSystemWindows(Rect insets) { setPadding(0, 0, 0, insets.bottom); return true; if (mNavigationGuard == null) { mNavigationGuard = findViewById(com.android.internal.R.id.navigationGuard); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); // draw navigation bar guard final int w = getMeasuredWidth(); final int h = getMeasuredHeight(); mGuardRect.set(0, h - getPaddingBottom(), w, h); canvas.drawRect(mGuardRect, mGuardPaint); if (mNavigationGuard == null) { return super.fitSystemWindows(insets); } ViewGroup.LayoutParams lp = mNavigationGuard.getLayoutParams(); lp.height = insets.bottom; mNavigationGuard.setLayoutParams(lp); return true; } }
core/res/res/layout/input_method.xml +5 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,9 @@ android:layout_height="wrap_content" android:visibility="gone"> </FrameLayout> <View android:id="@+id/navigationGuard" android:layout_width="match_parent" android:layout_height="0dp" android:background="@+color/input_method_navigation_guard"/> </com.android.internal.inputmethod.InputMethodRoot>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ <java-symbol type="id" name="month" /> <java-symbol type="id" name="month_name" /> <java-symbol type="id" name="name" /> <java-symbol type="id" name="navigationGuard" /> <java-symbol type="id" name="next" /> <java-symbol type="id" name="next_button" /> <java-symbol type="id" name="new_app_action" /> Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -2992,7 +2992,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.top = df.top = of.top = cf.top = vf.top = mDockTop; pf.right = df.right = of.right = cf.right = vf.right = mDockRight; // IM dock windows layout below the nav bar... pf.bottom = df.bottom = of.bottom = mRestrictedScreenTop + mRestrictedScreenHeight; pf.bottom = df.bottom = of.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; // ...with content insets above the nav bar cf.bottom = vf.bottom = mStableBottom; // IM dock windows always go to the bottom of the screen. Loading