mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Fix crash caused by removing update listener in update listener.
Bug: 80236772 Test: Fling all apps open, and catch it before it reaches the top Change-Id: I082a26b97afb7dbc162758ff9654e4a3707f9d7e
This commit is contained in:
@@ -466,9 +466,12 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
*/
|
||||
public void addSpringFromFlingUpdateListener(ValueAnimator animator, float velocity) {
|
||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
boolean shouldSpring = true;
|
||||
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||
if (valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) {
|
||||
if (shouldSpring
|
||||
&& valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) {
|
||||
int searchViewId = getSearchView().getId();
|
||||
addSpringView(searchViewId);
|
||||
|
||||
@@ -481,7 +484,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
}
|
||||
});
|
||||
|
||||
animator.removeUpdateListener(this);
|
||||
shouldSpring = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user