diff options
author | Adrian Roos <roosa@google.com> | 2015-08-12 18:06:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-12 18:06:42 +0000 |
commit | c0a4883d58554c84d10911da20f43be149b47c53 (patch) | |
tree | 549dc8ab0785ee5f4e54790157e3c5fae71be88f /core | |
parent | 0c7629579184f85d36a4854e7c6f5b81f5b7299e (diff) | |
parent | fe836fabd9c6d3a3a7aaa51db7bb9bd6c9239833 (diff) | |
download | frameworks_base-c0a4883d58554c84d10911da20f43be149b47c53.zip frameworks_base-c0a4883d58554c84d10911da20f43be149b47c53.tar.gz frameworks_base-c0a4883d58554c84d10911da20f43be149b47c53.tar.bz2 |
Merge "Prevent overlap of color views in landscape" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/policy/PhoneWindow.java | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index dd7ea45..a7bdbe0 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -2907,13 +2907,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mLastHasRightStableInset = hasRightStableInset; } - updateColorViewInt(mStatusColorViewState, sysUiVisibility, mStatusBarColor, - mLastTopInset, false /* matchVertical */, animate && !disallowAnimate); - boolean navBarToRightEdge = mLastBottomInset == 0 && mLastRightInset > 0; int navBarSize = navBarToRightEdge ? mLastRightInset : mLastBottomInset; updateColorViewInt(mNavigationColorViewState, sysUiVisibility, mNavigationBarColor, - navBarSize, navBarToRightEdge, animate && !disallowAnimate); + navBarSize, navBarToRightEdge, 0 /* rightInset */, + animate && !disallowAnimate); + + boolean statusBarNeedsRightInset = navBarToRightEdge + && mNavigationColorViewState.present; + int statusBarRightInset = statusBarNeedsRightInset ? mLastRightInset : 0; + updateColorViewInt(mStatusColorViewState, sysUiVisibility, mStatusBarColor, + mLastTopInset, false /* matchVertical */, statusBarRightInset, + animate && !disallowAnimate); } // When we expand the window with FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, we still need @@ -2966,15 +2971,17 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { * @param size the current size in the non-parent-matching dimension. * @param verticalBar if true the view is attached to a vertical edge, otherwise to a * horizontal edge, + * @param rightMargin rightMargin for the color view. * @param animate if true, the change will be animated. */ private void updateColorViewInt(final ColorViewState state, int sysUiVis, int color, - int size, boolean verticalBar, boolean animate) { - boolean show = size > 0 && (sysUiVis & state.systemUiHideFlag) == 0 + int size, boolean verticalBar, int rightMargin, boolean animate) { + state.present = size > 0 && (sysUiVis & state.systemUiHideFlag) == 0 && (getAttributes().flags & state.hideWindowFlag) == 0 - && (getAttributes().flags & state.translucentFlag) == 0 - && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; + boolean show = state.present + && (color & Color.BLACK) != 0 + && (getAttributes().flags & state.translucentFlag) == 0; boolean visibilityChanged = false; View view = state.view; @@ -2993,7 +3000,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { view.setVisibility(INVISIBLE); state.targetVisibility = VISIBLE; - addView(view, new LayoutParams(resolvedWidth, resolvedHeight, resolvedGravity)); + LayoutParams lp = new LayoutParams(resolvedWidth, resolvedHeight, + resolvedGravity); + lp.rightMargin = rightMargin; + addView(view, lp); updateColorViewTranslations(); } } else { @@ -3003,10 +3013,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (show) { LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp.height != resolvedHeight || lp.width != resolvedWidth - || lp.gravity != resolvedGravity) { + || lp.gravity != resolvedGravity || lp.rightMargin != rightMargin) { lp.height = resolvedHeight; lp.width = resolvedWidth; lp.gravity = resolvedGravity; + lp.rightMargin = rightMargin; view.setLayoutParams(lp); } view.setBackgroundColor(color); @@ -5022,6 +5033,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private static class ColorViewState { View view = null; int targetVisibility = View.INVISIBLE; + boolean present = false; final int id; final int systemUiHideFlag; |