Loading api/current.xml +95 −0 Original line number Diff line number Diff line Loading @@ -214823,6 +214823,19 @@ <parameter name="selected" type="boolean"> </parameter> </method> <method name="dispatchSystemUiVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="dispatchTouchEvent" return="boolean" abstract="false" Loading Loading @@ -215876,6 +215889,19 @@ visibility="protected" > </method> <method name="getSystemUiVisibility" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="getTag" return="java.lang.Object" abstract="false" Loading Loading @@ -218126,6 +218152,19 @@ <parameter name="l" type="android.view.View.OnLongClickListener"> </parameter> </method> <method name="setOnSystemUiVisibilityChangeListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="l" type="android.view.View.OnSystemUiVisibilityChangeListener"> </parameter> </method> <method name="setOnTouchListener" return="void" abstract="false" Loading Loading @@ -218379,6 +218418,19 @@ <parameter name="soundEffectsEnabled" type="boolean"> </parameter> </method> <method name="setSystemUiVisibility" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="setTag" return="void" abstract="false" Loading Loading @@ -219386,6 +219438,28 @@ visibility="public" > </field> <field name="STATUS_BAR_HIDDEN" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="STATUS_BAR_VISIBLE" type="int" transient="false" volatile="false" value="0" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="VIEW_LOG_TAG" type="java.lang.String" transient="false" Loading Loading @@ -219804,6 +219878,27 @@ </parameter> </method> </interface> <interface name="View.OnSystemUiVisibilityChangeListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onSystemUiVisibilityChange" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> </interface> <interface name="View.OnTouchListener" abstract="true" static="true" core/java/android/view/IWindow.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,9 @@ oneway interface IWindow { * Drag/drop events */ void dispatchDragEvent(in DragEvent event); /** * System chrome visibility changes */ void dispatchSystemUiVisibilityChanged(int visibility); } core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -187,4 +187,9 @@ interface IWindowManager * Create a screenshot of the applications currently displayed. */ Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight); /** * Called by the status bar to notify Views of changes to System UI visiblity. */ void statusBarVisibilityChanged(int visibility); } core/java/android/view/View.java +96 −7 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.Message; import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; import android.os.SystemProperties; import android.util.AttributeSet; Loading Loading @@ -1696,6 +1697,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ public static final int OVER_SCROLL_NEVER = 2; /** * View has requested the status bar to be visible (the default). * * @see setSystemUiVisibility */ public static final int STATUS_BAR_VISIBLE = 0; /** * View has requested the status bar to be visible (the default). * * @see setSystemUiVisibility */ public static final int STATUS_BAR_HIDDEN = 0x00000001; /** * Controls the over-scroll mode for this view. * See {@link #overScrollBy(int, int, int, int, int, int, int, int, boolean)}, Loading Loading @@ -1734,6 +1749,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility }) int mPrivateFlags; /** * This view's request for the visibility of the status bar. * @hide */ int mSystemUiVisibility; /** * Count of how many windows this view has been attached to. */ Loading Loading @@ -2037,6 +2058,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private OnDragListener mOnDragListener; private OnSystemUiVisibilityChangeListener mOnSystemUiVisibilityChangeListener; /** * The application environment this view lives in. * This field should be made private, so it is hidden from the SDK. Loading Loading @@ -4706,17 +4729,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } void performCollectViewAttributes(int visibility) { //noinspection PointlessBitwiseExpression if (((visibility | mViewFlags) & (VISIBILITY_MASK | KEEP_SCREEN_ON)) == (VISIBLE | KEEP_SCREEN_ON)) { if ((visibility & VISIBILITY_MASK) == VISIBLE) { if ((mViewFlags & KEEP_SCREEN_ON) == KEEP_SCREEN_ON) { mAttachInfo.mKeepScreenOn = true; } mAttachInfo.mSystemUiVisibility |= mSystemUiVisibility; if (mOnSystemUiVisibilityChangeListener != null) { mAttachInfo.mHasSystemUiListeners = true; } } } void needGlobalAttributesUpdate(boolean force) { AttachInfo ai = mAttachInfo; final AttachInfo ai = mAttachInfo; if (ai != null) { if (ai.mKeepScreenOn || force) { if (force || ai.mKeepScreenOn || (ai.mSystemUiVisibility != 0) || ai.mHasSystemUiListeners) { ai.mRecomputeGlobalAttributes = true; } } Loading Loading @@ -5301,7 +5329,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } if ((changed & KEEP_SCREEN_ON) != 0) { if (mParent != null) { if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } Loading Loading @@ -10617,6 +10645,40 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility (flags & HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) != 0); } /** * Request that the visibility of the status bar be changed. */ public void setSystemUiVisibility(int visibility) { if (visibility != mSystemUiVisibility) { mSystemUiVisibility = visibility; if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } } /** * Returns the status bar visibility that this view has requested. */ public int getSystemUiVisibility(int visibility) { return mSystemUiVisibility; } public void setOnSystemUiVisibilityChangeListener(OnSystemUiVisibilityChangeListener l) { mOnSystemUiVisibilityChangeListener = l; if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } /** */ public void dispatchSystemUiVisibilityChanged(int visibility) { if (mOnSystemUiVisibilityChangeListener != null) { mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility); } } /** * !!! TODO: real docs * Loading Loading @@ -11307,6 +11369,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo); } /** * Interface definition for a callback to be invoked when the status bar changes * visibility. * * @see #setOnSystemUiVisibilityChangeListener */ public interface OnSystemUiVisibilityChangeListener { /** * Called when the status bar changes visibility because of a call to * {@link #setSystemUiVisibility}. * * @param visibility {@link #STATUS_BAR_VISIBLE} or {@link #STATUS_BAR_HIDDEN}. */ public void onSystemUiVisibilityChange(int visibility); } private final class UnsetPressedState implements Runnable { public void run() { setPressed(false); Loading Loading @@ -11524,6 +11602,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ boolean mKeepScreenOn; /** * Bitwise-or of all of the values that views have passed to setSystemUiVisibility(). */ int mSystemUiVisibility; /** * True if a view in this hierarchy has an OnSystemUiVisibilityChangeListener * attached. */ boolean mHasSystemUiListeners; /** * Set if the visibility of any views has changed. */ Loading core/java/android/view/ViewGroup.java +16 −2 Original line number Diff line number Diff line Loading @@ -860,9 +860,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager * {@inheritDoc} */ public void recomputeViewAttributes(View child) { if (mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { ViewParent parent = mParent; if (parent != null) parent.recomputeViewAttributes(this); } } @Override void dispatchCollectViewAttributes(int visibility) { Loading Loading @@ -1070,6 +1072,18 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager return child.mCanAcceptDrop; } @Override public void dispatchSystemUiVisibilityChanged(int visible) { super.dispatchSystemUiVisibilityChanged(visible); final int count = mChildrenCount; final View[] children = mChildren; for (int i=0; i <count; i++) { final View child = children[i]; child.dispatchSystemUiVisibilityChanged(visible); } } /** * {@inheritDoc} */ Loading Loading
api/current.xml +95 −0 Original line number Diff line number Diff line Loading @@ -214823,6 +214823,19 @@ <parameter name="selected" type="boolean"> </parameter> </method> <method name="dispatchSystemUiVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="dispatchTouchEvent" return="boolean" abstract="false" Loading Loading @@ -215876,6 +215889,19 @@ visibility="protected" > </method> <method name="getSystemUiVisibility" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="getTag" return="java.lang.Object" abstract="false" Loading Loading @@ -218126,6 +218152,19 @@ <parameter name="l" type="android.view.View.OnLongClickListener"> </parameter> </method> <method name="setOnSystemUiVisibilityChangeListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="l" type="android.view.View.OnSystemUiVisibilityChangeListener"> </parameter> </method> <method name="setOnTouchListener" return="void" abstract="false" Loading Loading @@ -218379,6 +218418,19 @@ <parameter name="soundEffectsEnabled" type="boolean"> </parameter> </method> <method name="setSystemUiVisibility" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> <method name="setTag" return="void" abstract="false" Loading Loading @@ -219386,6 +219438,28 @@ visibility="public" > </field> <field name="STATUS_BAR_HIDDEN" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="STATUS_BAR_VISIBLE" type="int" transient="false" volatile="false" value="0" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="VIEW_LOG_TAG" type="java.lang.String" transient="false" Loading Loading @@ -219804,6 +219878,27 @@ </parameter> </method> </interface> <interface name="View.OnSystemUiVisibilityChangeListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onSystemUiVisibilityChange" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="visibility" type="int"> </parameter> </method> </interface> <interface name="View.OnTouchListener" abstract="true" static="true"
core/java/android/view/IWindow.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,9 @@ oneway interface IWindow { * Drag/drop events */ void dispatchDragEvent(in DragEvent event); /** * System chrome visibility changes */ void dispatchSystemUiVisibilityChanged(int visibility); }
core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -187,4 +187,9 @@ interface IWindowManager * Create a screenshot of the applications currently displayed. */ Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight); /** * Called by the status bar to notify Views of changes to System UI visiblity. */ void statusBarVisibilityChanged(int visibility); }
core/java/android/view/View.java +96 −7 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.Message; import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; import android.os.SystemProperties; import android.util.AttributeSet; Loading Loading @@ -1696,6 +1697,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ public static final int OVER_SCROLL_NEVER = 2; /** * View has requested the status bar to be visible (the default). * * @see setSystemUiVisibility */ public static final int STATUS_BAR_VISIBLE = 0; /** * View has requested the status bar to be visible (the default). * * @see setSystemUiVisibility */ public static final int STATUS_BAR_HIDDEN = 0x00000001; /** * Controls the over-scroll mode for this view. * See {@link #overScrollBy(int, int, int, int, int, int, int, int, boolean)}, Loading Loading @@ -1734,6 +1749,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility }) int mPrivateFlags; /** * This view's request for the visibility of the status bar. * @hide */ int mSystemUiVisibility; /** * Count of how many windows this view has been attached to. */ Loading Loading @@ -2037,6 +2058,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private OnDragListener mOnDragListener; private OnSystemUiVisibilityChangeListener mOnSystemUiVisibilityChangeListener; /** * The application environment this view lives in. * This field should be made private, so it is hidden from the SDK. Loading Loading @@ -4706,17 +4729,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } void performCollectViewAttributes(int visibility) { //noinspection PointlessBitwiseExpression if (((visibility | mViewFlags) & (VISIBILITY_MASK | KEEP_SCREEN_ON)) == (VISIBLE | KEEP_SCREEN_ON)) { if ((visibility & VISIBILITY_MASK) == VISIBLE) { if ((mViewFlags & KEEP_SCREEN_ON) == KEEP_SCREEN_ON) { mAttachInfo.mKeepScreenOn = true; } mAttachInfo.mSystemUiVisibility |= mSystemUiVisibility; if (mOnSystemUiVisibilityChangeListener != null) { mAttachInfo.mHasSystemUiListeners = true; } } } void needGlobalAttributesUpdate(boolean force) { AttachInfo ai = mAttachInfo; final AttachInfo ai = mAttachInfo; if (ai != null) { if (ai.mKeepScreenOn || force) { if (force || ai.mKeepScreenOn || (ai.mSystemUiVisibility != 0) || ai.mHasSystemUiListeners) { ai.mRecomputeGlobalAttributes = true; } } Loading Loading @@ -5301,7 +5329,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } if ((changed & KEEP_SCREEN_ON) != 0) { if (mParent != null) { if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } Loading Loading @@ -10617,6 +10645,40 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility (flags & HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING) != 0); } /** * Request that the visibility of the status bar be changed. */ public void setSystemUiVisibility(int visibility) { if (visibility != mSystemUiVisibility) { mSystemUiVisibility = visibility; if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } } /** * Returns the status bar visibility that this view has requested. */ public int getSystemUiVisibility(int visibility) { return mSystemUiVisibility; } public void setOnSystemUiVisibilityChangeListener(OnSystemUiVisibilityChangeListener l) { mOnSystemUiVisibilityChangeListener = l; if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { mParent.recomputeViewAttributes(this); } } /** */ public void dispatchSystemUiVisibilityChanged(int visibility) { if (mOnSystemUiVisibilityChangeListener != null) { mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility); } } /** * !!! TODO: real docs * Loading Loading @@ -11307,6 +11369,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo); } /** * Interface definition for a callback to be invoked when the status bar changes * visibility. * * @see #setOnSystemUiVisibilityChangeListener */ public interface OnSystemUiVisibilityChangeListener { /** * Called when the status bar changes visibility because of a call to * {@link #setSystemUiVisibility}. * * @param visibility {@link #STATUS_BAR_VISIBLE} or {@link #STATUS_BAR_HIDDEN}. */ public void onSystemUiVisibilityChange(int visibility); } private final class UnsetPressedState implements Runnable { public void run() { setPressed(false); Loading Loading @@ -11524,6 +11602,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ boolean mKeepScreenOn; /** * Bitwise-or of all of the values that views have passed to setSystemUiVisibility(). */ int mSystemUiVisibility; /** * True if a view in this hierarchy has an OnSystemUiVisibilityChangeListener * attached. */ boolean mHasSystemUiListeners; /** * Set if the visibility of any views has changed. */ Loading
core/java/android/view/ViewGroup.java +16 −2 Original line number Diff line number Diff line Loading @@ -860,9 +860,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager * {@inheritDoc} */ public void recomputeViewAttributes(View child) { if (mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { ViewParent parent = mParent; if (parent != null) parent.recomputeViewAttributes(this); } } @Override void dispatchCollectViewAttributes(int visibility) { Loading Loading @@ -1070,6 +1072,18 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager return child.mCanAcceptDrop; } @Override public void dispatchSystemUiVisibilityChanged(int visible) { super.dispatchSystemUiVisibilityChanged(visible); final int count = mChildrenCount; final View[] children = mChildren; for (int i=0; i <count; i++) { final View child = children[i]; child.dispatchSystemUiVisibilityChanged(visible); } } /** * {@inheritDoc} */ Loading