Prevent lingering divider animators in AbsSwipeUpHandler

- Refactor the util method to create the animator and track the existing
  animation in AbsSwipeUpHandler to be able to cancel it if another call
  to change the visbility comes in.  Note that this doesn't address
  the case where the launch animation overlaps with swipe up (though that
  hopefully shouldn't happen in normal usage)

Bug: 213403679
Test: Tap in the gesture space while split
Change-Id: I078a7d0f22c2ef2ba847796ec79e740c789ce1ae
This commit is contained in:
Winson Chung
2022-01-21 23:51:08 +00:00
parent 3b5e42d926
commit 26031b0dd2
3 changed files with 51 additions and 48 deletions
@@ -4237,9 +4237,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
if (isSuccess) {
if (tv.getTaskIds()[1] != -1) {
// TODO(b/194414938): make this part of the animations instead.
TaskViewUtils.setSplitAuxiliarySurfacesShown(mRemoteTargetHandles[0]
.getTransformParams().getTargetSet().nonApps,
true /*shown*/, false /*animate*/);
TaskViewUtils.createSplitAuxiliarySurfacesAnimator(
mRemoteTargetHandles[0].getTransformParams().getTargetSet().nonApps,
true /*shown*/, (dividerAnimator) -> {
dividerAnimator.start();
dividerAnimator.end();
});
}
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && tv.isRunningTask()) {
finishRecentsAnimation(false /* toRecents */, null);