From fad9555217ce3a657ffc7cba458a0d2622f7a379 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 17 Aug 2011 14:06:16 -0400 Subject: Allow views to setSystemUiVisibility() with the same value and have it work. This will save apps the trouble of having to first remove the lights-out or hide-navigation flags before reapplying them (in situations where the system UI has decided to override those flags). Bug: 5052456 Change-Id: I31f6ca9105379ae5f0216ebe3c39fc8d5d935f92 --- core/java/android/view/View.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e86f5d5e7b15..f0058e729908 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -12582,13 +12582,15 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit * Request that the visibility of the status bar be changed. * @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE} or * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}. + * + * This value will be re-applied immediately, even if the flags have not changed, so a view may + * easily reassert a particular SystemUiVisibility condition even if the system UI itself has + * since countermanded the original request. */ public void setSystemUiVisibility(int visibility) { - if (visibility != mSystemUiVisibility) { - mSystemUiVisibility = visibility; - if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { - mParent.recomputeViewAttributes(this); - } + mSystemUiVisibility = visibility; + if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { + mParent.recomputeViewAttributes(this); } } -- cgit v1.2.3-59-g8ed1b