diff options
| author | 2023-11-15 14:08:55 +0100 | |
|---|---|---|
| committer | 2023-11-15 14:21:47 +0100 | |
| commit | e96e39cfc1c5d9a1a7ac33fa6fa881120e8fb1cd (patch) | |
| tree | 90ffeb3c40721fa0a1fb7ebf4a4a07244755a592 | |
| parent | a891bc207743712bc33ee1c0e5c73667e2328981 (diff) | |
Fix notification shade not expanding from right side after unfold
The width of mKeyguardStatusBar is not adjusted when unfolding. It is only adjusted once the shade gets expanded the first time. Therefore we need to query the window width and use that instead for the back bypass check.
Bug: 309628369
Flag: LEGACY WM_SHADE_ANIMATE_BACK_GESTURE DISABLED
Test: Manual, i.e. testing shade expansion behaviour after unfolding
Change-Id: I4c8453fb6bd2357f9c975435e0806b33a8375164
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java index 3c68438ff61b..4e1505649da2 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java @@ -261,6 +261,14 @@ public class QuickSettingsController implements Dumpable { private Insets mCachedGestureInsets; /** + * The window width currently in effect -- used together with + * {@link QuickSettingsController#mCachedGestureInsets} to decide whether a back gesture should + * receive a horizontal swipe inwards from the left/right vertical edge of the screen. + * We cache this on ACTION_DOWN, and query it during both ACTION_DOWN and ACTION_MOVE events. + */ + private int mCachedWindowWidth; + + /** * The amount of progress we are currently in if we're transitioning to the full shade. * 0.0f means we're not transitioning yet, while 1 means we're all the way in the full * shade. This value can also go beyond 1.1 when we're overshooting! @@ -544,6 +552,7 @@ public class QuickSettingsController implements Dumpable { WindowMetrics windowMetrics = wm.getCurrentWindowMetrics(); mCachedGestureInsets = windowMetrics.getWindowInsets().getInsets( WindowInsets.Type.systemGestures()); + mCachedWindowWidth = windowMetrics.getBounds().width(); } /** @@ -552,7 +561,7 @@ public class QuickSettingsController implements Dumpable { */ public boolean shouldBackBypassQuickSettings(float touchX) { return (touchX < mCachedGestureInsets.left) - || (touchX > mKeyguardStatusBar.getWidth() - mCachedGestureInsets.right); + || (touchX > mCachedWindowWidth - mCachedGestureInsets.right); } /** Returns whether touch is within QS area */ @@ -2121,6 +2130,8 @@ public class QuickSettingsController implements Dumpable { ipw.println(mAnimatorExpand); ipw.print("mCachedGestureInsets="); ipw.println(mCachedGestureInsets); + ipw.print("mCachedWindowWidth="); + ipw.println(mCachedWindowWidth); ipw.print("mTransitioningToFullShadeProgress="); ipw.println(mTransitioningToFullShadeProgress); ipw.print("mDistanceForFullShadeTransition="); |