diff options
| author | 2023-03-29 14:38:29 +0900 | |
|---|---|---|
| committer | 2023-03-30 09:01:17 +0000 | |
| commit | 292094e873b67e8f67ce59842134730e78924379 (patch) | |
| tree | 86057538ef8af44e00913299ea8e7461db3ef21d | |
| parent | 73314bbbf621a7c462abaa0c973f76c9ac74e955 (diff) | |
Use correct gravity for 3-button gesture insets
3-button nav bar can be on sides instead of the bottom when the display
rotates, always use the nav bar height value from the resource and put
it at the bottom as mandatory gesture insets is not a reliable way to
provide the correct value. Use the nav bar frame for the insets.
Bug: 273445780
Test: TaplTestsLauncher3
Test: See reproduce steps in the bug
Change-Id: I19e87390dbf7ade1e5b2fb6490f8ca550c476026
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index 44c718f26a4a..e8ef612ae2cf 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -1732,6 +1732,11 @@ public class NavigationBar extends ViewController<NavigationBarView> implements final int gestureHeight = userContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.navigation_bar_gesture_height); final boolean handlingGesture = mEdgeBackGestureHandler.isHandlingGestures(); + final InsetsFrameProvider mandatoryGestureProvider = new InsetsFrameProvider( + mInsetsSourceOwner, 0, WindowInsets.Type.mandatorySystemGestures()); + if (handlingGesture) { + mandatoryGestureProvider.setInsetsSize(Insets.of(0, 0, 0, gestureHeight)); + } final int gestureInsetsLeft = handlingGesture ? mEdgeBackGestureHandler.getEdgeWidthLeft() + safeInsetsLeft : 0; final int gestureInsetsRight = handlingGesture @@ -1739,9 +1744,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements return new InsetsFrameProvider[] { navBarProvider, tappableElementProvider, - new InsetsFrameProvider( - mInsetsSourceOwner, 0, WindowInsets.Type.mandatorySystemGestures()) - .setInsetsSize(Insets.of(0, 0, 0, gestureHeight)), + mandatoryGestureProvider, new InsetsFrameProvider(mInsetsSourceOwner, 0, WindowInsets.Type.systemGestures()) .setSource(InsetsFrameProvider.SOURCE_DISPLAY) .setInsetsSize(Insets.of(gestureInsetsLeft, 0, 0, 0)), |