diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt index bcb9cecb1d..c3774eb65b 100644 --- a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt +++ b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt @@ -60,8 +60,6 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC ) } - var splitInstructionsView: SplitInstructionsView? = null - /** * Returns different elements to animate for the initial split selection animation * depending on the state of the surface from which the split was initiated @@ -235,7 +233,8 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC animatorSet.addListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { splitSelectStateController.resetState() - safeRemoveViewFromDragLayer(launcher, splitInstructionsView) + safeRemoveViewFromDragLayer(launcher, + splitSelectStateController.splitInstructionsView) } }) return animatorSet @@ -246,8 +245,9 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC * app for splitscreen */ fun getShowSplitInstructionsAnim(launcher: StatefulActivity<*>) : PendingAnimation { - safeRemoveViewFromDragLayer(launcher, splitInstructionsView) - splitInstructionsView = SplitInstructionsView.getSplitInstructionsView(launcher) + safeRemoveViewFromDragLayer(launcher, splitSelectStateController.splitInstructionsView) + val splitInstructionsView = SplitInstructionsView.getSplitInstructionsView(launcher) + splitSelectStateController.splitInstructionsView = splitInstructionsView val timings = AnimUtils.getDeviceOverviewToSplitTimings(launcher.deviceProfile.isTablet) val anim = PendingAnimation(100 /*duration */) anim.setViewAlpha(splitInstructionsView, 1f, @@ -267,7 +267,7 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC /** Removes the split instructions view from [launcher] drag layer. */ fun removeSplitInstructionsView(launcher: StatefulActivity<*>) { - safeRemoveViewFromDragLayer(launcher, splitInstructionsView) + safeRemoveViewFromDragLayer(launcher, splitSelectStateController.splitInstructionsView) } private fun safeRemoveViewFromDragLayer(launcher: StatefulActivity<*>, view: View?) { diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index c42b8342b6..453a1bdf13 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -73,6 +73,7 @@ import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.TaskViewUtils; import com.android.quickstep.views.FloatingTaskView; import com.android.quickstep.views.GroupedTaskView; +import com.android.quickstep.views.SplitInstructionsView; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; @@ -113,6 +114,7 @@ public class SplitSelectStateController { private GroupedTaskView mLaunchingTaskView; private FloatingTaskView mFirstFloatingTaskView; + private SplitInstructionsView mSplitInstructionsView; private final List mSplitSelectionListeners = new ArrayList<>(); @@ -630,6 +632,7 @@ public class SplitSelectStateController { mAnimateCurrentTaskDismissal = false; mDismissingFromSplitPair = false; mFirstFloatingTaskView = null; + mSplitInstructionsView = null; } /** @@ -660,11 +663,20 @@ public class SplitSelectStateController { mFirstFloatingTaskView = floatingTaskView; } + public void setSplitInstructionsView(SplitInstructionsView splitInstructionsView) { + mSplitInstructionsView = splitInstructionsView; + } + @Nullable public FloatingTaskView getFirstFloatingTaskView() { return mFirstFloatingTaskView; } + @Nullable + public SplitInstructionsView getSplitInstructionsView() { + return mSplitInstructionsView; + } + public AppPairsController getAppPairsController() { return mAppPairsController; } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 29d9fa6819..d580178d13 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -683,8 +683,6 @@ public abstract class RecentsView { mSplitSelectStateController.launchSplitTasks( @@ -4819,9 +4819,8 @@ public abstract class RecentsView