Merge "Prevent flings after motion gestures on fully expanded keyguard" into tm-qpr-dev
This commit is contained in:
@@ -3508,12 +3508,15 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) {
|
private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) {
|
||||||
|
// don't fling while in keyguard to avoid jump in shade expand animation
|
||||||
|
boolean fullyExpandedInKeyguard = mBarState == KEYGUARD && mExpandedFraction >= 1.0;
|
||||||
mTrackingPointer = -1;
|
mTrackingPointer = -1;
|
||||||
mAmbientState.setSwipingUp(false);
|
mAmbientState.setSwipingUp(false);
|
||||||
if ((mTracking && mTouchSlopExceeded) || Math.abs(x - mInitialExpandX) > mTouchSlop
|
if (!fullyExpandedInKeyguard && ((mTracking && mTouchSlopExceeded)
|
||||||
|
|| Math.abs(x - mInitialExpandX) > mTouchSlop
|
||||||
|| Math.abs(y - mInitialExpandY) > mTouchSlop
|
|| Math.abs(y - mInitialExpandY) > mTouchSlop
|
||||||
|| (!isFullyExpanded() && !isFullyCollapsed())
|
|| (!isFullyExpanded() && !isFullyCollapsed())
|
||||||
|| event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel) {
|
|| event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel)) {
|
||||||
mVelocityTracker.computeCurrentVelocity(1000);
|
mVelocityTracker.computeCurrentVelocity(1000);
|
||||||
float vel = mVelocityTracker.getYVelocity();
|
float vel = mVelocityTracker.getYVelocity();
|
||||||
float vectorVel = (float) Math.hypot(
|
float vectorVel = (float) Math.hypot(
|
||||||
@@ -3561,9 +3564,9 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
if (mUpdateFlingOnLayout) {
|
if (mUpdateFlingOnLayout) {
|
||||||
mUpdateFlingVelocity = vel;
|
mUpdateFlingVelocity = vel;
|
||||||
}
|
}
|
||||||
} else if (!mCentralSurfaces.isBouncerShowing()
|
} else if (fullyExpandedInKeyguard || (!mCentralSurfaces.isBouncerShowing()
|
||||||
&& !mAlternateBouncerInteractor.isVisibleState()
|
&& !mAlternateBouncerInteractor.isVisibleState()
|
||||||
&& !mKeyguardStateController.isKeyguardGoingAway()) {
|
&& !mKeyguardStateController.isKeyguardGoingAway())) {
|
||||||
onEmptySpaceClick();
|
onEmptySpaceClick();
|
||||||
onTrackingStopped(true);
|
onTrackingStopped(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user