summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2015-10-15 15:38:38 -0700
committerAdrian Roos <roosa@google.com>2015-10-15 15:39:46 -0700
commitfc7476da7a59f0fb7b07d6e188ae6d0b55f140b8 (patch)
treefd5b65bd3ea7cb79ba50c1bcdc78c536149e5edb /core
parent575b629ef8e21cca5a40acaafeee7653d90956fe (diff)
downloadframeworks_base-fc7476da7a59f0fb7b07d6e188ae6d0b55f140b8.zip
frameworks_base-fc7476da7a59f0fb7b07d6e188ae6d0b55f140b8.tar.gz
frameworks_base-fc7476da7a59f0fb7b07d6e188ae6d0b55f140b8.tar.bz2
Fix wrongly laid out navigation color view
The SystemUI visibility listener in DecorView gets called between the measure and layout passes and is therefore not allowed to change layout parameters. This change makes sure that changes to the color view layout parameters are applied eagerly when the insets change instead of waiting for the views to become visible. Bug: 24614374 Change-Id: If9df18f582163d0869c28a852c36697b1ce50621
Diffstat (limited to 'core')
-rw-r--r--core/java/com/android/internal/policy/PhoneWindow.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index a7bdbe0..8e8d352 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -3010,16 +3010,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
int vis = show ? VISIBLE : INVISIBLE;
visibilityChanged = state.targetVisibility != vis;
state.targetVisibility = vis;
+ LayoutParams lp = (LayoutParams) view.getLayoutParams();
+ if (lp.height != resolvedHeight || lp.width != resolvedWidth
+ || lp.gravity != resolvedGravity || lp.rightMargin != rightMargin) {
+ lp.height = resolvedHeight;
+ lp.width = resolvedWidth;
+ lp.gravity = resolvedGravity;
+ lp.rightMargin = rightMargin;
+ view.setLayoutParams(lp);
+ }
if (show) {
- LayoutParams lp = (LayoutParams) view.getLayoutParams();
- if (lp.height != resolvedHeight || lp.width != resolvedWidth
- || lp.gravity != resolvedGravity || lp.rightMargin != rightMargin) {
- lp.height = resolvedHeight;
- lp.width = resolvedWidth;
- lp.gravity = resolvedGravity;
- lp.rightMargin = rightMargin;
- view.setLayoutParams(lp);
- }
view.setBackgroundColor(color);
}
}