From fc7476da7a59f0fb7b07d6e188ae6d0b55f140b8 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 15 Oct 2015 15:38:38 -0700 Subject: 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 --- core/java/com/android/internal/policy/PhoneWindow.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/java/com') 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); } } -- cgit v1.1