Loading core/java/android/inputmethodservice/InputMethodService.java +6 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.inputmethodservice; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; import android.annotation.CallSuper; import android.annotation.DrawableRes; Loading Loading @@ -852,6 +853,11 @@ public class InputMethodService extends AbstractInputMethodService { Context.LAYOUT_INFLATER_SERVICE); mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState, WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); // For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set // by default (but IME developers can opt this out later if they want a new behavior). mWindow.getWindow().setFlags( FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); initViews(); mWindow.getWindow().setLayout(MATCH_PARENT, WRAP_CONTENT); } Loading Loading @@ -882,8 +888,6 @@ public class InputMethodService extends AbstractInputMethodService { mThemeAttrs = obtainStyledAttributes(android.R.styleable.InputMethodService); mRootView = mInflater.inflate( com.android.internal.R.layout.input_method, null); mRootView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); mWindow.setContentView(mRootView); mRootView.getViewTreeObserver().removeOnComputeInternalInsetsListener(mInsetsComputer); mRootView.getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsComputer); Loading core/java/com/android/internal/policy/DecorView.java +6 −52 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ import static android.view.Window.DECOR_CAPTION_SHADE_LIGHT; import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; Loading Loading @@ -194,8 +193,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind // View added at runtime to draw under the status bar area private View mStatusGuard; // View added at runtime to draw under the navigation bar area private View mNavigationGuard; private final ColorViewState mStatusColorViewState = new ColorViewState(STATUS_BAR_COLOR_VIEW_ATTRIBUTES); Loading Loading @@ -1002,7 +999,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind mFrameOffsets.set(insets.getSystemWindowInsets()); insets = updateColorViews(insets, true /* animate */); insets = updateStatusGuard(insets); insets = updateNavigationGuard(insets); if (getForeground() != null) { drawableChanged(); } Loading Loading @@ -1062,7 +1058,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind WindowManager.LayoutParams attrs = mWindow.getAttributes(); int sysUiVisibility = attrs.systemUiVisibility | getWindowSystemUiVisibility(); if (!mWindow.mIsFloating) { // IME is an exceptional floating window that requires color view. final boolean isImeWindow = mWindow.getAttributes().type == WindowManager.LayoutParams.TYPE_INPUT_METHOD; if (!mWindow.mIsFloating || isImeWindow) { boolean disallowAnimate = !isLaidOut(); disallowAnimate |= ((mLastWindowFlags ^ attrs.flags) & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; Loading Loading @@ -1363,7 +1362,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind if (mStatusGuard == null) { mStatusGuard = new View(mContext); mStatusGuard.setBackgroundColor(mContext.getColor( R.color.input_method_navigation_guard)); R.color.decor_view_status_guard)); addView(mStatusGuard, indexOfChild(mStatusColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, mlp.topMargin, Gravity.START | Gravity.TOP)); Loading Loading @@ -1407,51 +1406,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind return insets; } private WindowInsets updateNavigationGuard(WindowInsets insets) { // IME windows lay out below the nav bar, but the content view must not (for back compat) // Only make this adjustment if the window is not requesting layout in overscan if (mWindow.getAttributes().type == WindowManager.LayoutParams.TYPE_INPUT_METHOD && (mWindow.getAttributes().flags & FLAG_LAYOUT_IN_OVERSCAN) == 0) { // prevent the content view from including the nav bar height if (mWindow.mContentParent != null) { if (mWindow.mContentParent.getLayoutParams() instanceof MarginLayoutParams) { MarginLayoutParams mlp = (MarginLayoutParams) mWindow.mContentParent.getLayoutParams(); mlp.bottomMargin = insets.getSystemWindowInsetBottom(); mWindow.mContentParent.setLayoutParams(mlp); } } // position the navigation guard view, creating it if necessary if (mNavigationGuard == null) { mNavigationGuard = new View(mContext); mNavigationGuard.setBackgroundColor(mContext.getColor( R.color.input_method_navigation_guard)); addView(mNavigationGuard, indexOfChild(mNavigationColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, insets.getSystemWindowInsetBottom(), Gravity.START | Gravity.BOTTOM)); } else { LayoutParams lp = (LayoutParams) mNavigationGuard.getLayoutParams(); lp.height = insets.getSystemWindowInsetBottom(); mNavigationGuard.setLayoutParams(lp); } updateNavigationGuardColor(); insets = insets.consumeSystemWindowInsets( false, false, false, true /* bottom */); } return insets; } void updateNavigationGuardColor() { if (mNavigationGuard != null) { // Make navigation bar guard invisible if the transparent color is specified. // Only TRANSPARENT is sufficient for hiding the navigation bar if the no software // keyboard is shown by IMS. mNavigationGuard.setVisibility(mWindow.getNavigationBarColor() == Color.TRANSPARENT ? View.INVISIBLE : View.VISIBLE); } } /** * Overrides the view outline when the activity enters picture-in-picture to ensure that it has * an opaque shadow even if the window background is completely transparent. This only applies Loading Loading @@ -2103,7 +2057,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind for (int i = getChildCount() - 1; i >= 0; i--) { View v = getChildAt(i); if (v != mStatusColorViewState.view && v != mNavigationColorViewState.view && v != mStatusGuard && v != mNavigationGuard) { && v != mStatusGuard) { removeViewAt(i); } } Loading core/java/com/android/internal/policy/PhoneWindow.java +0 −1 Original line number Diff line number Diff line Loading @@ -3807,7 +3807,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mForcedNavigationBarColor = true; if (mDecor != null) { mDecor.updateColorViews(null, false /* animate */); mDecor.updateNavigationGuardColor(); } } Loading core/res/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ <drawable name="editbox_dropdown_light_frame">@drawable/editbox_dropdown_background</drawable> <drawable name="input_method_fullscreen_background">#fff9f9f9</drawable> <color name="input_method_navigation_guard">#ff000000</color> <color name="decor_view_status_guard">#ff000000</color> <!-- For date picker widget --> <drawable name="selected_day_background">#ff0092f4</drawable> Loading core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1815,7 +1815,7 @@ <java-symbol type="bool" name="config_wimaxEnabled" /> <java-symbol type="bool" name="show_ongoing_ime_switcher" /> <java-symbol type="color" name="config_defaultNotificationColor" /> <java-symbol type="color" name="input_method_navigation_guard" /> <java-symbol type="color" name="decor_view_status_guard" /> <java-symbol type="drawable" name="ic_notification_ime_default" /> <java-symbol type="drawable" name="ic_menu_refresh" /> <java-symbol type="drawable" name="ic_settings" /> Loading Loading
core/java/android/inputmethodservice/InputMethodService.java +6 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.inputmethodservice; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; import android.annotation.CallSuper; import android.annotation.DrawableRes; Loading Loading @@ -852,6 +853,11 @@ public class InputMethodService extends AbstractInputMethodService { Context.LAYOUT_INFLATER_SERVICE); mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState, WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); // For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set // by default (but IME developers can opt this out later if they want a new behavior). mWindow.getWindow().setFlags( FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); initViews(); mWindow.getWindow().setLayout(MATCH_PARENT, WRAP_CONTENT); } Loading Loading @@ -882,8 +888,6 @@ public class InputMethodService extends AbstractInputMethodService { mThemeAttrs = obtainStyledAttributes(android.R.styleable.InputMethodService); mRootView = mInflater.inflate( com.android.internal.R.layout.input_method, null); mRootView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); mWindow.setContentView(mRootView); mRootView.getViewTreeObserver().removeOnComputeInternalInsetsListener(mInsetsComputer); mRootView.getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsComputer); Loading
core/java/com/android/internal/policy/DecorView.java +6 −52 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ import static android.view.Window.DECOR_CAPTION_SHADE_LIGHT; import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; Loading Loading @@ -194,8 +193,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind // View added at runtime to draw under the status bar area private View mStatusGuard; // View added at runtime to draw under the navigation bar area private View mNavigationGuard; private final ColorViewState mStatusColorViewState = new ColorViewState(STATUS_BAR_COLOR_VIEW_ATTRIBUTES); Loading Loading @@ -1002,7 +999,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind mFrameOffsets.set(insets.getSystemWindowInsets()); insets = updateColorViews(insets, true /* animate */); insets = updateStatusGuard(insets); insets = updateNavigationGuard(insets); if (getForeground() != null) { drawableChanged(); } Loading Loading @@ -1062,7 +1058,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind WindowManager.LayoutParams attrs = mWindow.getAttributes(); int sysUiVisibility = attrs.systemUiVisibility | getWindowSystemUiVisibility(); if (!mWindow.mIsFloating) { // IME is an exceptional floating window that requires color view. final boolean isImeWindow = mWindow.getAttributes().type == WindowManager.LayoutParams.TYPE_INPUT_METHOD; if (!mWindow.mIsFloating || isImeWindow) { boolean disallowAnimate = !isLaidOut(); disallowAnimate |= ((mLastWindowFlags ^ attrs.flags) & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; Loading Loading @@ -1363,7 +1362,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind if (mStatusGuard == null) { mStatusGuard = new View(mContext); mStatusGuard.setBackgroundColor(mContext.getColor( R.color.input_method_navigation_guard)); R.color.decor_view_status_guard)); addView(mStatusGuard, indexOfChild(mStatusColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, mlp.topMargin, Gravity.START | Gravity.TOP)); Loading Loading @@ -1407,51 +1406,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind return insets; } private WindowInsets updateNavigationGuard(WindowInsets insets) { // IME windows lay out below the nav bar, but the content view must not (for back compat) // Only make this adjustment if the window is not requesting layout in overscan if (mWindow.getAttributes().type == WindowManager.LayoutParams.TYPE_INPUT_METHOD && (mWindow.getAttributes().flags & FLAG_LAYOUT_IN_OVERSCAN) == 0) { // prevent the content view from including the nav bar height if (mWindow.mContentParent != null) { if (mWindow.mContentParent.getLayoutParams() instanceof MarginLayoutParams) { MarginLayoutParams mlp = (MarginLayoutParams) mWindow.mContentParent.getLayoutParams(); mlp.bottomMargin = insets.getSystemWindowInsetBottom(); mWindow.mContentParent.setLayoutParams(mlp); } } // position the navigation guard view, creating it if necessary if (mNavigationGuard == null) { mNavigationGuard = new View(mContext); mNavigationGuard.setBackgroundColor(mContext.getColor( R.color.input_method_navigation_guard)); addView(mNavigationGuard, indexOfChild(mNavigationColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, insets.getSystemWindowInsetBottom(), Gravity.START | Gravity.BOTTOM)); } else { LayoutParams lp = (LayoutParams) mNavigationGuard.getLayoutParams(); lp.height = insets.getSystemWindowInsetBottom(); mNavigationGuard.setLayoutParams(lp); } updateNavigationGuardColor(); insets = insets.consumeSystemWindowInsets( false, false, false, true /* bottom */); } return insets; } void updateNavigationGuardColor() { if (mNavigationGuard != null) { // Make navigation bar guard invisible if the transparent color is specified. // Only TRANSPARENT is sufficient for hiding the navigation bar if the no software // keyboard is shown by IMS. mNavigationGuard.setVisibility(mWindow.getNavigationBarColor() == Color.TRANSPARENT ? View.INVISIBLE : View.VISIBLE); } } /** * Overrides the view outline when the activity enters picture-in-picture to ensure that it has * an opaque shadow even if the window background is completely transparent. This only applies Loading Loading @@ -2103,7 +2057,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind for (int i = getChildCount() - 1; i >= 0; i--) { View v = getChildAt(i); if (v != mStatusColorViewState.view && v != mNavigationColorViewState.view && v != mStatusGuard && v != mNavigationGuard) { && v != mStatusGuard) { removeViewAt(i); } } Loading
core/java/com/android/internal/policy/PhoneWindow.java +0 −1 Original line number Diff line number Diff line Loading @@ -3807,7 +3807,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mForcedNavigationBarColor = true; if (mDecor != null) { mDecor.updateColorViews(null, false /* animate */); mDecor.updateNavigationGuardColor(); } } Loading
core/res/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ <drawable name="editbox_dropdown_light_frame">@drawable/editbox_dropdown_background</drawable> <drawable name="input_method_fullscreen_background">#fff9f9f9</drawable> <color name="input_method_navigation_guard">#ff000000</color> <color name="decor_view_status_guard">#ff000000</color> <!-- For date picker widget --> <drawable name="selected_day_background">#ff0092f4</drawable> Loading
core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1815,7 +1815,7 @@ <java-symbol type="bool" name="config_wimaxEnabled" /> <java-symbol type="bool" name="show_ongoing_ime_switcher" /> <java-symbol type="color" name="config_defaultNotificationColor" /> <java-symbol type="color" name="input_method_navigation_guard" /> <java-symbol type="color" name="decor_view_status_guard" /> <java-symbol type="drawable" name="ic_notification_ime_default" /> <java-symbol type="drawable" name="ic_menu_refresh" /> <java-symbol type="drawable" name="ic_settings" /> Loading