diff options
| author | Adam Powell <adamp@google.com> | 2014-04-15 17:38:54 -0700 |
|---|---|---|
| committer | Adam Powell <adamp@google.com> | 2014-04-16 14:59:16 -0700 |
| commit | 973ddaacaef255b8659d35cfe4151dd5b7436138 (patch) | |
| tree | 3608969bb1744d06b7e1d5afed37130a0cf45df5 /core/java/android/view/ViewRootImpl.java | |
| parent | fa72a9eaae6170e65d9ba72720ee7b0d752f8847 (diff) | |
| download | frameworks_base-973ddaacaef255b8659d35cfe4151dd5b7436138.zip frameworks_base-973ddaacaef255b8659d35cfe4151dd5b7436138.tar.gz frameworks_base-973ddaacaef255b8659d35cfe4151dd5b7436138.tar.bz2 | |
DO NOT MERGE Add isRound to WindowInsets
isRound allows a view to determine whether the window it is contained
within obscures the corners of the window content. This allows views
aware of this property to adapt their layout accordingly.
Switch ViewRootImpl to use dispatchApplyInsets instead of
fitSystemWindows.
Change-Id: Ic3e3936b73815b2593cb9720af1a309fbd18406e
Conflicts:
core/java/android/view/ViewRootImpl.java
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 521cfbf..db80aed 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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; @@ -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 { @@ -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 @@ -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); |
