Creating a new dismiss animation while one is pending is now valid

It used to be an invalid state to create a new dismiss animation while
one was pending, because the only way to do it was to swipe up. However,
now there are a number of places we create the dismiss animation, e.g.:
- When entering split screen
- Clear all
- Uninstalling an app

So now, instead of calling this an illegal state, we simply cancel the
previous pending dismiss if it exists.

Bug: 118880699
Bug: 118400078
Change-Id: I4d073f7e9d50e832ba4ae55391530040a0fac50c
This commit is contained in:
Tony Wickham 2018-11-13 15:47:29 -08:00
parent 9d9310ba72
commit cad49c6721
1 changed files with 3 additions and 6 deletions

View File

@ -24,7 +24,6 @@ import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW; import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
import static com.android.quickstep.WindowTransformSwipeHandler.MIN_PROGRESS_FOR_OVERVIEW; import static com.android.quickstep.WindowTransformSwipeHandler.MIN_PROGRESS_FOR_OVERVIEW;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorSet; import android.animation.AnimatorSet;
import android.animation.LayoutTransition; import android.animation.LayoutTransition;
@ -60,7 +59,7 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ListView; import android.widget.ListView;
import androidx.annotation.Nullable;
import com.android.launcher3.BaseActivity; import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable; import com.android.launcher3.Insettable;
@ -91,8 +90,6 @@ import com.android.systemui.shared.system.TaskStackChangeListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.function.Consumer; import java.util.function.Consumer;
import androidx.annotation.Nullable;
/** /**
* A list of recent tasks. * A list of recent tasks.
*/ */
@ -893,8 +890,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
public PendingAnimation createTaskDismissAnimation(TaskView taskView, boolean animateTaskView, public PendingAnimation createTaskDismissAnimation(TaskView taskView, boolean animateTaskView,
boolean shouldRemoveTask, long duration) { boolean shouldRemoveTask, long duration) {
if (FeatureFlags.IS_DOGFOOD_BUILD && mPendingAnimation != null) { if (mPendingAnimation != null) {
throw new IllegalStateException("Another pending animation is still running"); mPendingAnimation.finish(false, Touch.SWIPE);
} }
AnimatorSet anim = new AnimatorSet(); AnimatorSet anim = new AnimatorSet();
PendingAnimation pendingAnimation = new PendingAnimation(anim); PendingAnimation pendingAnimation = new PendingAnimation(anim);