diff options
author | Alan Viverette <alanv@google.com> | 2014-09-19 09:30:03 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-19 09:30:03 +0000 |
commit | ec9f3fdb6814a7838c0c4d90f1ff8953bf389827 (patch) | |
tree | e081fa3d77915812d533fecd76e6b7aed876cbcc /policy | |
parent | e81a195ca776d234dc30137701dccbb84116bd32 (diff) | |
parent | 684f37ce9a6f65969cbe523932ed1f2e889e9032 (diff) | |
download | frameworks_base-ec9f3fdb6814a7838c0c4d90f1ff8953bf389827.zip frameworks_base-ec9f3fdb6814a7838c0c4d90f1ff8953bf389827.tar.gz frameworks_base-ec9f3fdb6814a7838c0c4d90f1ff8953bf389827.tar.bz2 |
am df7f8e24: am 4ed54216: am 89b0ec71: am d03ba30b: Merge "Always apply window insets to action modes" into lmp-dev
* commit 'df7f8e2447323e918bace1ff03349f1432d6c729':
Always apply window insets to action modes
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 3419119..94c1676 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2887,32 +2887,35 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mActionModeView.getLayoutParams() instanceof MarginLayoutParams) { MarginLayoutParams mlp = (MarginLayoutParams) mActionModeView.getLayoutParams(); boolean mlpChanged = false; - final boolean nonOverlayShown = - (getLocalFeatures() & (1 << FEATURE_ACTION_MODE_OVERLAY)) == 0 - && mActionModeView.isShown(); - if (nonOverlayShown) { - // set top margin to top insets, show status guard + if (mActionModeView.isShown()) { + final boolean nonOverlay = (getLocalFeatures() + & (1 << FEATURE_ACTION_MODE_OVERLAY)) == 0; if (mlp.topMargin != insets.getSystemWindowInsetTop()) { mlpChanged = true; mlp.topMargin = insets.getSystemWindowInsetTop(); - if (mStatusGuard == null) { - mStatusGuard = new View(mContext); - mStatusGuard.setBackgroundColor(mContext.getResources() - .getColor(R.color.input_method_navigation_guard)); - addView(mStatusGuard, indexOfChild(mStatusColorView), - new LayoutParams(LayoutParams.MATCH_PARENT, mlp.topMargin, - Gravity.START | Gravity.TOP)); - } else { - LayoutParams lp = (LayoutParams) mStatusGuard.getLayoutParams(); - if (lp.height != mlp.topMargin) { - lp.height = mlp.topMargin; - mStatusGuard.setLayoutParams(lp); + + // Only show status guard for non-overlay modes. + if (nonOverlay) { + if (mStatusGuard == null) { + mStatusGuard = new View(mContext); + mStatusGuard.setBackgroundColor(mContext.getResources() + .getColor(R.color.input_method_navigation_guard)); + addView(mStatusGuard, indexOfChild(mStatusColorView), + new LayoutParams(LayoutParams.MATCH_PARENT, + mlp.topMargin, + Gravity.START | Gravity.TOP)); + } else { + LayoutParams lp = (LayoutParams) mStatusGuard.getLayoutParams(); + if (lp.height != mlp.topMargin) { + lp.height = mlp.topMargin; + mStatusGuard.setLayoutParams(lp); + } } } } insets = insets.consumeSystemWindowInsets( - false, true /* top */, false, false); - showStatusGuard = true; + false, nonOverlay /* top */, false, false); + showStatusGuard = nonOverlay; } else { // reset top margin if (mlp.topMargin != 0) { |