Fix NPE when closing folder. am: a28e0f474a
Change-Id: I9361391fab78e10e727635c7b27aca97b5698038
This commit is contained in:
commit
ae3efb2232
|
@ -164,6 +164,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
|||
@Thunk final ArrayList<View> mItemsInReadingOrder = new ArrayList<View>();
|
||||
|
||||
private AnimatorSet mCurrentAnimator;
|
||||
private boolean mIsAnimatingClosed = false;
|
||||
|
||||
protected final Launcher mLauncher;
|
||||
protected DragController mDragController;
|
||||
|
@ -729,15 +730,24 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
|||
}
|
||||
|
||||
private void animateClosed() {
|
||||
if (mIsAnimatingClosed) {
|
||||
return;
|
||||
}
|
||||
if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
|
||||
mCurrentAnimator.cancel();
|
||||
}
|
||||
AnimatorSet a = new FolderAnimationManager(this, false /* isOpening */).getAnimator();
|
||||
a.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
mIsAnimatingClosed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
closeComplete(true);
|
||||
announceAccessibilityChanges();
|
||||
mIsAnimatingClosed = false;
|
||||
}
|
||||
});
|
||||
startAnimation(a);
|
||||
|
|
Loading…
Reference in New Issue