Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +14 −4 Original line number Diff line number Diff line Loading @@ -374,11 +374,10 @@ public class SwipeHelper implements Gefingerpoken { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: final boolean captured = (mIsSwiping || mLongPressSent || mMenuRowIntercepting); mIsSwiping = false; mTouchedView = null; mLongPressSent = false; mCallback.onLongPressSent(null); mMenuRowIntercepting = false; resetSwipeState(); cancelLongPress(); if (captured) return true; break; Loading Loading @@ -491,7 +490,7 @@ public class SwipeHelper implements Gefingerpoken { } if (!mCancelled || wasRemoved) { mCallback.onChildDismissed(animView); resetSwipeState(); resetSwipeOfView(animView); } if (endAction != null) { endAction.accept(mCancelled); Loading Loading @@ -546,7 +545,7 @@ public class SwipeHelper implements Gefingerpoken { if (!cancelled) { updateSwipeProgressFromOffset(animView, canBeDismissed); resetSwipeState(); resetSwipeOfView(animView); } onChildSnappedBack(animView, targetLeft); }); Loading Loading @@ -806,9 +805,20 @@ public class SwipeHelper implements Gefingerpoken { return mIsSwiping ? mTouchedView : null; } protected void resetSwipeOfView(View view) { if (getSwipedView() == view) { resetSwipeState(); } } public void resetSwipeState() { View swipedView = getSwipedView(); mTouchedView = null; mIsSwiping = false; if (swipedView != null) { snapChildIfNeeded(swipedView, false, 0); onChildSnappedBack(swipedView, 0); } } private float getTouchSlop(MotionEvent event) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +9 −5 Original line number Diff line number Diff line Loading @@ -4189,10 +4189,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mCentralSurfaces.resetUserExpandedStates(); clearTemporaryViews(); clearUserLockedViews(); if (mSwipeHelper.isSwiping()) { mSwipeHelper.resetSwipeState(); updateContinuousShadowDrawing(); } cancelActiveSwipe(); } } Loading Loading @@ -4264,6 +4261,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (!mIsExpanded) { mGroupExpansionManager.collapseGroups(); mExpandHelper.cancelImmediately(); if (!mIsExpansionChanging) { cancelActiveSwipe(); } } updateNotificationAnimationStates(); updateChronometers(); Loading Loading @@ -6113,7 +6113,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void cancelActiveSwipe() { mSwipeHelper.resetSwipeState(); updateContinuousShadowDrawing(); } void updateContinuousShadowDrawing() { boolean continuousShadowUpdate = mAnimationRunning || mSwipeHelper.isSwiping(); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -800,6 +800,34 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertEquals(mAmbientState.getScrollY(), 0); } @Test public void onShadeClosesWithAnimationWillResetSwipeState() { // GIVEN shade is expanded mStackScroller.setIsExpanded(true); clearInvocations(mNotificationSwipeHelper); // WHEN closing the shade with the animations mStackScroller.onExpansionStarted(); mStackScroller.setIsExpanded(false); mStackScroller.onExpansionStopped(); // VERIFY swipe is reset verify(mNotificationSwipeHelper).resetSwipeState(); } @Test public void onShadeClosesWithoutAnimationWillResetSwipeState() { // GIVEN shade is expanded mStackScroller.setIsExpanded(true); clearInvocations(mNotificationSwipeHelper); // WHEN closing the shade without the animation mStackScroller.setIsExpanded(false); // VERIFY swipe is reset verify(mNotificationSwipeHelper).resetSwipeState(); } @Test public void testSplitShade_hasTopOverscroll() { mTestableResources Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +14 −4 Original line number Diff line number Diff line Loading @@ -374,11 +374,10 @@ public class SwipeHelper implements Gefingerpoken { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: final boolean captured = (mIsSwiping || mLongPressSent || mMenuRowIntercepting); mIsSwiping = false; mTouchedView = null; mLongPressSent = false; mCallback.onLongPressSent(null); mMenuRowIntercepting = false; resetSwipeState(); cancelLongPress(); if (captured) return true; break; Loading Loading @@ -491,7 +490,7 @@ public class SwipeHelper implements Gefingerpoken { } if (!mCancelled || wasRemoved) { mCallback.onChildDismissed(animView); resetSwipeState(); resetSwipeOfView(animView); } if (endAction != null) { endAction.accept(mCancelled); Loading Loading @@ -546,7 +545,7 @@ public class SwipeHelper implements Gefingerpoken { if (!cancelled) { updateSwipeProgressFromOffset(animView, canBeDismissed); resetSwipeState(); resetSwipeOfView(animView); } onChildSnappedBack(animView, targetLeft); }); Loading Loading @@ -806,9 +805,20 @@ public class SwipeHelper implements Gefingerpoken { return mIsSwiping ? mTouchedView : null; } protected void resetSwipeOfView(View view) { if (getSwipedView() == view) { resetSwipeState(); } } public void resetSwipeState() { View swipedView = getSwipedView(); mTouchedView = null; mIsSwiping = false; if (swipedView != null) { snapChildIfNeeded(swipedView, false, 0); onChildSnappedBack(swipedView, 0); } } private float getTouchSlop(MotionEvent event) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +9 −5 Original line number Diff line number Diff line Loading @@ -4189,10 +4189,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mCentralSurfaces.resetUserExpandedStates(); clearTemporaryViews(); clearUserLockedViews(); if (mSwipeHelper.isSwiping()) { mSwipeHelper.resetSwipeState(); updateContinuousShadowDrawing(); } cancelActiveSwipe(); } } Loading Loading @@ -4264,6 +4261,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (!mIsExpanded) { mGroupExpansionManager.collapseGroups(); mExpandHelper.cancelImmediately(); if (!mIsExpansionChanging) { cancelActiveSwipe(); } } updateNotificationAnimationStates(); updateChronometers(); Loading Loading @@ -6113,7 +6113,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void cancelActiveSwipe() { mSwipeHelper.resetSwipeState(); updateContinuousShadowDrawing(); } void updateContinuousShadowDrawing() { boolean continuousShadowUpdate = mAnimationRunning || mSwipeHelper.isSwiping(); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -800,6 +800,34 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertEquals(mAmbientState.getScrollY(), 0); } @Test public void onShadeClosesWithAnimationWillResetSwipeState() { // GIVEN shade is expanded mStackScroller.setIsExpanded(true); clearInvocations(mNotificationSwipeHelper); // WHEN closing the shade with the animations mStackScroller.onExpansionStarted(); mStackScroller.setIsExpanded(false); mStackScroller.onExpansionStopped(); // VERIFY swipe is reset verify(mNotificationSwipeHelper).resetSwipeState(); } @Test public void onShadeClosesWithoutAnimationWillResetSwipeState() { // GIVEN shade is expanded mStackScroller.setIsExpanded(true); clearInvocations(mNotificationSwipeHelper); // WHEN closing the shade without the animation mStackScroller.setIsExpanded(false); // VERIFY swipe is reset verify(mNotificationSwipeHelper).resetSwipeState(); } @Test public void testSplitShade_hasTopOverscroll() { mTestableResources Loading