diff options
| author | 2024-07-24 16:00:24 +0000 | |
|---|---|---|
| committer | 2024-07-24 16:00:24 +0000 | |
| commit | 469e8ebd0ab0436e2049966af4849e672430d37c (patch) | |
| tree | cdcda7b21e065acd826ffdd28a438bc8f6cbe97e /libs | |
| parent | 98112a97bca06c87d59abe15eb1759d8ccaa5f54 (diff) | |
| parent | bbca8a9cc9d666e0cf6d85fe5c62270bf745021c (diff) | |
Merge "Add taskbarFrameHeight getters to SystemBarUtils" into main
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java index 86cec02ab138..84e32a229f9e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java @@ -81,6 +81,7 @@ public class DisplayLayout { private boolean mHasNavigationBar = false; private boolean mHasStatusBar = false; private int mNavBarFrameHeight = 0; + private int mTaskbarFrameHeight = 0; private boolean mAllowSeamlessRotationDespiteNavBarMoving = false; private boolean mNavigationBarCanMove = false; private boolean mReverseDefaultRotation = false; @@ -119,6 +120,7 @@ public class DisplayLayout { && mNavigationBarCanMove == other.mNavigationBarCanMove && mReverseDefaultRotation == other.mReverseDefaultRotation && mNavBarFrameHeight == other.mNavBarFrameHeight + && mTaskbarFrameHeight == other.mTaskbarFrameHeight && Objects.equals(mInsetsState, other.mInsetsState); } @@ -126,7 +128,7 @@ public class DisplayLayout { public int hashCode() { return Objects.hash(mUiMode, mWidth, mHeight, mCutout, mRotation, mDensityDpi, mNonDecorInsets, mStableInsets, mHasNavigationBar, mHasStatusBar, - mNavBarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, + mNavBarFrameHeight, mTaskbarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, mNavigationBarCanMove, mReverseDefaultRotation, mInsetsState); } @@ -176,6 +178,7 @@ public class DisplayLayout { mNavigationBarCanMove = dl.mNavigationBarCanMove; mReverseDefaultRotation = dl.mReverseDefaultRotation; mNavBarFrameHeight = dl.mNavBarFrameHeight; + mTaskbarFrameHeight = dl.mTaskbarFrameHeight; mNonDecorInsets.set(dl.mNonDecorInsets); mStableInsets.set(dl.mStableInsets); mInsetsState.set(dl.mInsetsState, true /* copySources */); @@ -214,7 +217,8 @@ public class DisplayLayout { if (mHasStatusBar) { convertNonDecorInsetsToStableInsets(res, mStableInsets, mCutout, mHasStatusBar); } - mNavBarFrameHeight = getNavigationBarFrameHeight(res, mWidth > mHeight); + mNavBarFrameHeight = getNavigationBarFrameHeight(res, /* landscape */ mWidth > mHeight); + mTaskbarFrameHeight = SystemBarUtils.getTaskbarHeight(res); } /** @@ -321,6 +325,17 @@ public class DisplayLayout { outBounds.inset(mStableInsets); } + /** Predicts the calculated stable bounds when in Desktop Mode. */ + public void getStableBoundsForDesktopMode(Rect outBounds) { + getStableBounds(outBounds); + + if (mNavBarFrameHeight != mTaskbarFrameHeight) { + // Currently not in pinned taskbar mode, exclude taskbar insets instead of current + // navigation insets from bounds. + outBounds.bottom = mHeight - mTaskbarFrameHeight; + } + } + /** * Gets navigation bar position for this layout * @return Navigation bar position for this layout. |