Merge "Make touchXOutsideOfQs require split shade to be enabled" into tm-qpr-dev am: 6e8b02c25c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20691916

Change-Id: I258acbf5de23de792a1f1df54eb1ce6b7bcf67b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-12-14 06:24:09 +00:00
committed by Automerger Merge Worker

View File

@@ -2325,7 +2325,7 @@ public final class NotificationPanelViewController implements Dumpable {
private boolean handleQsTouch(MotionEvent event) { private boolean handleQsTouch(MotionEvent event) {
if (mSplitShadeEnabled && touchXOutsideOfQs(event.getX())) { if (isSplitShadeAndTouchXOutsideQs(event.getX())) {
return false; return false;
} }
final int action = event.getActionMasked(); final int action = event.getActionMasked();
@@ -2382,12 +2382,14 @@ public final class NotificationPanelViewController implements Dumpable {
return false; return false;
} }
private boolean touchXOutsideOfQs(float touchX) { /** Returns whether split shade is enabled and an x coordinate is outside of the QS frame. */
return touchX < mQsFrame.getX() || touchX > mQsFrame.getX() + mQsFrame.getWidth(); private boolean isSplitShadeAndTouchXOutsideQs(float touchX) {
return mSplitShadeEnabled && (touchX < mQsFrame.getX()
|| touchX > mQsFrame.getX() + mQsFrame.getWidth());
} }
private boolean isInQsArea(float x, float y) { private boolean isInQsArea(float x, float y) {
if (touchXOutsideOfQs(x)) { if (isSplitShadeAndTouchXOutsideQs(x)) {
return false; return false;
} }
// Let's reject anything at the very bottom around the home handle in gesture nav // Let's reject anything at the very bottom around the home handle in gesture nav
@@ -5316,7 +5318,7 @@ public final class NotificationPanelViewController implements Dumpable {
@Override @Override
public void flingTopOverscroll(float velocity, boolean open) { public void flingTopOverscroll(float velocity, boolean open) {
// in split shade mode we want to expand/collapse QS only when touch happens within QS // in split shade mode we want to expand/collapse QS only when touch happens within QS
if (mSplitShadeEnabled && touchXOutsideOfQs(mInitialTouchX)) { if (isSplitShadeAndTouchXOutsideQs(mInitialTouchX)) {
return; return;
} }
mLastOverscroll = 0f; mLastOverscroll = 0f;