From e6627ebfed80dfe95bf3ad22dfe1234faf03e710 Mon Sep 17 00:00:00 2001 From: arangelov Date: Wed, 15 Aug 2018 19:58:01 +0100 Subject: [PATCH] Don't call BottomUserEducationView#close() while running animation. If while the work profile info card opening animation was playing you pressed the Work tab repeatedly, close() was called. That caused the animation to never complete properly (onAnimationEnd() was never called). This CL makes sure to not call close() if the animation is still running. Bug: 112471462 Bug: 112188042 Test: Manual Change-Id: I2e62e0c5c6f1d6132ea359a85cb6aadf57639c30 --- src/com/android/launcher3/views/AbstractSlideInView.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index 59bea48c8c..26c8f243b5 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -108,7 +108,8 @@ public abstract class AbstractSlideInView extends AbstractFloatingView @Override public boolean onControllerTouchEvent(MotionEvent ev) { mSwipeDetector.onTouchEvent(ev); - if (ev.getAction() == MotionEvent.ACTION_UP && mSwipeDetector.isIdleState()) { + if (ev.getAction() == MotionEvent.ACTION_UP && mSwipeDetector.isIdleState() + && !isOpeningAnimationRunning()) { // If we got ACTION_UP without ever starting swipe, close the panel. if (!getPopupContainer().isEventOverView(mContent, ev)) { close(true); @@ -117,6 +118,10 @@ public abstract class AbstractSlideInView extends AbstractFloatingView return true; } + private boolean isOpeningAnimationRunning() { + return mIsOpen && mOpenCloseAnimator.isRunning(); + } + /* SwipeDetector.Listener */ @Override @@ -154,7 +159,7 @@ public abstract class AbstractSlideInView extends AbstractFloatingView onCloseComplete(); return; } - if (!mIsOpen || mOpenCloseAnimator.isRunning()) { + if (!mIsOpen) { return; } mOpenCloseAnimator.setValues(