@@ -5209,6 +5209,13 @@ public boolean isShown() {
52095209 * call to continue to your children, you must be sure to call the super
52105210 * implementation.
52115211 *
5212+ * <p>Here is a sample layout that makes use of fitting system windows
5213+ * to have controls for a video view placed inside of the window decorations
5214+ * that it hides and shows. This can be used with code like the second
5215+ * sample (video player) shown in {@link #setSystemUiVisibility(int)}.
5216+ *
5217+ * {@sample development/samples/ApiDemos/res/layout/video_player.xml complete}
5218+ *
52125219 * @param insets Current content insets of the window. Prior to
52135220 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN} you must not modify
52145221 * the insets or else you and Android will be unhappy.
@@ -5251,7 +5258,8 @@ public void setFitsSystemWindows(boolean fitSystemWindows) {
52515258 }
52525259
52535260 /**
5254- * Check for the FITS_SYSTEM_WINDOWS flag. If this method returns true, this view
5261+ * Check for state of {@link #setFitsSystemWindows(boolean). If this method
5262+ * returns true, this view
52555263 * will account for system screen decorations such as the status bar and inset its
52565264 * content. This allows the view to be positioned in absolute screen coordinates
52575265 * and remain visible to the user.
@@ -5260,7 +5268,7 @@ public void setFitsSystemWindows(boolean fitSystemWindows) {
52605268 *
52615269 * @attr ref android.R.styleable#View_fitsSystemWindows
52625270 */
5263- public boolean fitsSystemWindows () {
5271+ public boolean getFitsSystemWindows () {
52645272 return (mViewFlags & FITS_SYSTEM_WINDOWS) == FITS_SYSTEM_WINDOWS;
52655273 }
52665274
@@ -15376,7 +15384,8 @@ public boolean performHapticFeedback(int feedbackConstant, int flags) {
1537615384 * playing the application would like to go into a complete full-screen mode,
1537715385 * to use as much of the display as possible for the video. When in this state
1537815386 * the user can not interact with the application; the system intercepts
15379- * touching on the screen to pop the UI out of full screen mode.
15387+ * touching on the screen to pop the UI out of full screen mode. See
15388+ * {@link #fitSystemWindows(Rect)} for a sample layout that goes with this code.
1538015389 *
1538115390 * {@sample development/samples/ApiDemos/src/com/example/android/apis/view/VideoPlayerActivity.java
1538215391 * content}
@@ -15458,11 +15467,13 @@ public void dispatchSystemUiVisibilityChanged(int visibility) {
1545815467 }
1545915468 }
1546015469
15461- void updateLocalSystemUiVisibility(int localValue, int localChanges) {
15470+ boolean updateLocalSystemUiVisibility(int localValue, int localChanges) {
1546215471 int val = (mSystemUiVisibility&~localChanges) | (localValue&localChanges);
1546315472 if (val != mSystemUiVisibility) {
1546415473 setSystemUiVisibility(val);
15474+ return true;
1546515475 }
15476+ return false;
1546615477 }
1546715478
1546815479 /** @hide */
@@ -16861,7 +16872,7 @@ public interface OnCreateContextMenuListener {
1686116872 /**
1686216873 * Interface definition for a callback to be invoked when the status bar changes
1686316874 * visibility. This reports <strong>global</strong> changes to the system UI
16864- * state, not just what the application is requesting.
16875+ * state, not what the application is requesting.
1686516876 *
1686616877 * @see View#setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener)
1686716878 */
@@ -16870,10 +16881,10 @@ public interface OnSystemUiVisibilityChangeListener {
1687016881 * Called when the status bar changes visibility because of a call to
1687116882 * {@link View#setSystemUiVisibility(int)}.
1687216883 *
16873- * @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE} or
16874- * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}. This tells you the
16875- * <strong>global</strong> state of the UI visibility flags, not what your
16876- * app is currently applying.
16884+ * @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE},
16885+ * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}, and {@link #SYSTEM_UI_FLAG_FULLSCREEN}.
16886+ * This tells you the <strong>global</strong> state of these UI visibility
16887+ * flags, not what your app is currently applying.
1687716888 */
1687816889 public void onSystemUiVisibilityChange(int visibility);
1687916890 }
@@ -17158,6 +17169,11 @@ public void setPooled(boolean isPooled) {
1715817169 */
1715917170 int mDisabledSystemUiVisibility;
1716017171
17172+ /**
17173+ * Last global system UI visibility reported by the window manager.
17174+ */
17175+ int mGlobalSystemUiVisibility;
17176+
1716117177 /**
1716217178 * True if a view in this hierarchy has an OnSystemUiVisibilityChangeListener
1716317179 * attached.
0 commit comments