Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28949,6 +28949,7 @@ package android.view { method public boolean hasInsets(); method public boolean hasSystemWindowInsets(); method public boolean hasWindowDecorInsets(); method public boolean isRound(); } public abstract interface WindowManager implements android.view.ViewManager { core/java/android/view/ViewRootImpl.java +8 −6 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,11 @@ public final class ViewRootImpl implements ViewParent, return windowSizeMayChange; } void dispatchApplyInsets(View host) { mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.dispatchApplyWindowInsets(new WindowInsets(mFitSystemWindowsInsets)); } private void performTraversals() { // cache mView since it is used so much below... final View host = mView; Loading Loading @@ -1242,8 +1247,7 @@ public final class ViewRootImpl implements ViewParent, } host.dispatchAttachedToWindow(attachInfo, 0); attachInfo.mTreeObserver.dispatchOnWindowAttachedChange(true); mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); //Log.i(TAG, "Screen on initialized: " + attachInfo.mKeepScreenOn); } else { Loading Loading @@ -1368,9 +1372,8 @@ public final class ViewRootImpl implements ViewParent, if (mFitSystemWindowsRequested) { mFitSystemWindowsRequested = false; mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); mLastOverscanRequested = mAttachInfo.mOverscanRequested; host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); if (mLayoutRequested) { // Short-circuit catching a new layout request here, so // we don't need to go through two layout passes when things Loading Loading @@ -1549,8 +1552,7 @@ public final class ViewRootImpl implements ViewParent, mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility; mLastOverscanRequested = mAttachInfo.mOverscanRequested; mFitSystemWindowsRequested = false; mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); } if (visibleInsetsChanged) { mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets); Loading core/java/android/view/WindowInsets.java +24 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public class WindowInsets { private Rect mSystemWindowInsets; private Rect mWindowDecorInsets; private Rect mTempRect; private boolean mIsRound; private static final Rect EMPTY_RECT = new Rect(0, 0, 0, 0); Loading @@ -46,8 +47,14 @@ public class WindowInsets { /** @hide */ public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets) { this(systemWindowInsets, windowDecorInsets, false); } /** @hide */ public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets, boolean isRound) { mSystemWindowInsets = systemWindowInsets; mWindowDecorInsets = windowDecorInsets; mIsRound = isRound; } /** Loading @@ -58,12 +65,12 @@ public class WindowInsets { public WindowInsets(WindowInsets src) { mSystemWindowInsets = src.mSystemWindowInsets; mWindowDecorInsets = src.mWindowDecorInsets; mIsRound = src.mIsRound; } /** @hide */ public WindowInsets(Rect systemWindowInsets) { mSystemWindowInsets = systemWindowInsets; mWindowDecorInsets = EMPTY_RECT; this(systemWindowInsets, EMPTY_RECT); } /** Loading Loading @@ -220,6 +227,20 @@ public class WindowInsets { return hasSystemWindowInsets() || hasWindowDecorInsets(); } /** * Returns true if the associated window has a round shape. * * <p>A round window's left, top, right and bottom edges reach all the way to the * associated edges of the window but the corners may not be visible. Views responding * to round insets should take care to not lay out critical elements within the corners * where they may not be accessible.</p> * * @return True if the window is round */ public boolean isRound() { return mIsRound; } public WindowInsets cloneWithSystemWindowInsetsConsumed() { final WindowInsets result = new WindowInsets(this); result.mSystemWindowInsets = new Rect(0, 0, 0, 0); Loading Loading @@ -273,6 +294,6 @@ public class WindowInsets { @Override public String toString() { return "WindowInsets{systemWindowInsets=" + mSystemWindowInsets + " windowDecorInsets=" + mWindowDecorInsets + "}"; mWindowDecorInsets + (isRound() ? "round}" : "}"); } } Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28949,6 +28949,7 @@ package android.view { method public boolean hasInsets(); method public boolean hasSystemWindowInsets(); method public boolean hasWindowDecorInsets(); method public boolean isRound(); } public abstract interface WindowManager implements android.view.ViewManager {
core/java/android/view/ViewRootImpl.java +8 −6 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,11 @@ public final class ViewRootImpl implements ViewParent, return windowSizeMayChange; } void dispatchApplyInsets(View host) { mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.dispatchApplyWindowInsets(new WindowInsets(mFitSystemWindowsInsets)); } private void performTraversals() { // cache mView since it is used so much below... final View host = mView; Loading Loading @@ -1242,8 +1247,7 @@ public final class ViewRootImpl implements ViewParent, } host.dispatchAttachedToWindow(attachInfo, 0); attachInfo.mTreeObserver.dispatchOnWindowAttachedChange(true); mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); //Log.i(TAG, "Screen on initialized: " + attachInfo.mKeepScreenOn); } else { Loading Loading @@ -1368,9 +1372,8 @@ public final class ViewRootImpl implements ViewParent, if (mFitSystemWindowsRequested) { mFitSystemWindowsRequested = false; mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); mLastOverscanRequested = mAttachInfo.mOverscanRequested; host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); if (mLayoutRequested) { // Short-circuit catching a new layout request here, so // we don't need to go through two layout passes when things Loading Loading @@ -1549,8 +1552,7 @@ public final class ViewRootImpl implements ViewParent, mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility; mLastOverscanRequested = mAttachInfo.mOverscanRequested; mFitSystemWindowsRequested = false; mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); host.fitSystemWindows(mFitSystemWindowsInsets); dispatchApplyInsets(host); } if (visibleInsetsChanged) { mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets); Loading
core/java/android/view/WindowInsets.java +24 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public class WindowInsets { private Rect mSystemWindowInsets; private Rect mWindowDecorInsets; private Rect mTempRect; private boolean mIsRound; private static final Rect EMPTY_RECT = new Rect(0, 0, 0, 0); Loading @@ -46,8 +47,14 @@ public class WindowInsets { /** @hide */ public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets) { this(systemWindowInsets, windowDecorInsets, false); } /** @hide */ public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets, boolean isRound) { mSystemWindowInsets = systemWindowInsets; mWindowDecorInsets = windowDecorInsets; mIsRound = isRound; } /** Loading @@ -58,12 +65,12 @@ public class WindowInsets { public WindowInsets(WindowInsets src) { mSystemWindowInsets = src.mSystemWindowInsets; mWindowDecorInsets = src.mWindowDecorInsets; mIsRound = src.mIsRound; } /** @hide */ public WindowInsets(Rect systemWindowInsets) { mSystemWindowInsets = systemWindowInsets; mWindowDecorInsets = EMPTY_RECT; this(systemWindowInsets, EMPTY_RECT); } /** Loading Loading @@ -220,6 +227,20 @@ public class WindowInsets { return hasSystemWindowInsets() || hasWindowDecorInsets(); } /** * Returns true if the associated window has a round shape. * * <p>A round window's left, top, right and bottom edges reach all the way to the * associated edges of the window but the corners may not be visible. Views responding * to round insets should take care to not lay out critical elements within the corners * where they may not be accessible.</p> * * @return True if the window is round */ public boolean isRound() { return mIsRound; } public WindowInsets cloneWithSystemWindowInsetsConsumed() { final WindowInsets result = new WindowInsets(this); result.mSystemWindowInsets = new Rect(0, 0, 0, 0); Loading Loading @@ -273,6 +294,6 @@ public class WindowInsets { @Override public String toString() { return "WindowInsets{systemWindowInsets=" + mSystemWindowInsets + " windowDecorInsets=" + mWindowDecorInsets + "}"; mWindowDecorInsets + (isRound() ? "round}" : "}"); } }