diff options
| author | Michael Kolb <kolby@google.com> | 2014-04-16 22:52:31 +0000 | 
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-16 22:52:31 +0000 | 
| commit | 46175e152891eabd9051523f2f077de5a5562996 (patch) | |
| tree | 6f9fe86d80116a818f6e734b21b011e036847a6f /core/java | |
| parent | cc9d2766726a1335ed178b4fdcea7ee2ba59b152 (diff) | |
| parent | 01ebfbd0a0a3a89b563ab6c8c346c669eca39a1a (diff) | |
| download | frameworks_base-46175e152891eabd9051523f2f077de5a5562996.zip frameworks_base-46175e152891eabd9051523f2f077de5a5562996.tar.gz frameworks_base-46175e152891eabd9051523f2f077de5a5562996.tar.bz2 | |
Merge "Revert "Add isRound to WindowInsets""
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 14 | ||||
| -rw-r--r-- | core/java/android/view/WindowInsets.java | 27 | 
2 files changed, 9 insertions, 32 deletions
| diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index eec4354..ef22def 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1171,11 +1171,6 @@ public final class ViewRootImpl implements ViewParent,          m.preTranslate(-attachInfo.mWindowLeft, -attachInfo.mWindowTop);      } -    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; @@ -1262,7 +1257,8 @@ public final class ViewRootImpl implements ViewParent,              }              host.dispatchAttachedToWindow(attachInfo, 0);              attachInfo.mTreeObserver.dispatchOnWindowAttachedChange(true); -            dispatchApplyInsets(host); +            mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); +            host.fitSystemWindows(mFitSystemWindowsInsets);              //Log.i(TAG, "Screen on initialized: " + attachInfo.mKeepScreenOn);          } else { @@ -1387,8 +1383,9 @@ public final class ViewRootImpl implements ViewParent,          if (mFitSystemWindowsRequested) {              mFitSystemWindowsRequested = false; +            mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);              mLastOverscanRequested = mAttachInfo.mOverscanRequested; -            dispatchApplyInsets(host); +            host.fitSystemWindows(mFitSystemWindowsInsets);              if (mLayoutRequested) {                  // Short-circuit catching a new layout request here, so                  // we don't need to go through two layout passes when things @@ -1562,7 +1559,8 @@ public final class ViewRootImpl implements ViewParent,                      mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility;                      mLastOverscanRequested = mAttachInfo.mOverscanRequested;                      mFitSystemWindowsRequested = false; -                    dispatchApplyInsets(host); +                    mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets); +                    host.fitSystemWindows(mFitSystemWindowsInsets);                  }                  if (visibleInsetsChanged) {                      mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets); diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java index f8cc793..cdfcb43 100644 --- a/core/java/android/view/WindowInsets.java +++ b/core/java/android/view/WindowInsets.java @@ -33,7 +33,6 @@ 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); @@ -47,14 +46,8 @@ 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;      }      /** @@ -65,12 +58,12 @@ public class WindowInsets {      public WindowInsets(WindowInsets src) {          mSystemWindowInsets = src.mSystemWindowInsets;          mWindowDecorInsets = src.mWindowDecorInsets; -        mIsRound = src.mIsRound;      }      /** @hide */      public WindowInsets(Rect systemWindowInsets) { -        this(systemWindowInsets, EMPTY_RECT); +        mSystemWindowInsets = systemWindowInsets; +        mWindowDecorInsets = EMPTY_RECT;      }      /** @@ -227,20 +220,6 @@ 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); @@ -294,6 +273,6 @@ public class WindowInsets {      @Override      public String toString() {          return "WindowInsets{systemWindowInsets=" + mSystemWindowInsets + " windowDecorInsets=" + -                mWindowDecorInsets + (isRound() ? "round}" : "}"); +                mWindowDecorInsets + "}";      }  } | 
