diff options
author | John Spurlock <jspurlock@google.com> | 2013-10-18 17:34:42 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-10-18 18:41:22 -0400 |
commit | ae3349e1c34f7aceddc526cd11d9ac44951e97b6 (patch) | |
tree | cb239dd55da5783b75d452982c80d508d70e4edf /core/java/com | |
parent | ac2d61a2d731946afed300d63039d6d712fd7f4c (diff) | |
download | frameworks_base-ae3349e1c34f7aceddc526cd11d9ac44951e97b6.zip frameworks_base-ae3349e1c34f7aceddc526cd11d9ac44951e97b6.tar.gz frameworks_base-ae3349e1c34f7aceddc526cd11d9ac44951e97b6.tar.bz2 |
Move the IME navigation guard view up to decor.
Although the IME windows are now allowed to extend into
the nav bar, some IMEs were making assumptions about
computed insets based on the height of the content view.
So our navigation bar view (opaque view blocking the nav bar
area to avoid the island effect when transparent) needs to live
above the content view in the hierarchy, making the content view
the same height as it was before.
A surgical spot to put the guard view is up at the root view
(PhoneWindow.DecorView). fitSystemWindows is always called since
this view is not recreated, and the layout is stable: waiting until
the IME is attached to the window is too late to add a guard view.
This is above the screen_* layouts, so will work without having to
touch all of them. And it only affects windows of TYPE_INPUT_METHOD.
Bug:11237795
Change-Id: I6a93f30aec83f1cecfb854073046cbc87ab4aa66
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/inputmethod/InputMethodRoot.java | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/core/java/com/android/internal/inputmethod/InputMethodRoot.java b/core/java/com/android/internal/inputmethod/InputMethodRoot.java deleted file mode 100644 index eddea99..0000000 --- a/core/java/com/android/internal/inputmethod/InputMethodRoot.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.inputmethod; - -import android.content.Context; -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 View mNavigationGuard; - - public InputMethodRoot(Context context) { - this(context, null); - } - - public InputMethodRoot(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public InputMethodRoot(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs); - } - - @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - requestFitSystemWindows(); - } - - @Override - protected boolean fitSystemWindows(Rect insets) { - if (mNavigationGuard == null) { - mNavigationGuard = findViewById(com.android.internal.R.id.navigationGuard); - } - if (mNavigationGuard == null) { - return super.fitSystemWindows(insets); - } - ViewGroup.LayoutParams lp = mNavigationGuard.getLayoutParams(); - lp.height = insets.bottom; - mNavigationGuard.setLayoutParams(lp); - return true; - } -} |