[automerger] Fix crash caused by removing update listener in update listener. am: 012d39a0e9
am: cd1727c069
Change-Id: Icd7aab53e7bd7cb65132f10ff752165ff57e2b46
This commit is contained in:
commit
76c59da5c0
|
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue