mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
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
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user