Dismiss split select when tapping on home button

Bug: 276361926
Test: Initate split, dismiss whenever home is pressed,
doesn't dismiss when all apps dragged down
Flag: ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE

Change-Id: Idc95123e27963c3913d04c6eb27f0e4c9b1eb401
This commit is contained in:
Vinit Nayak committed 2023-07-10 11:06:42 -07:00
1 parent 5e2a2564e8
commit f6c2e87747
5 files changed
+43 -7

No files matched your search

@@ -17,6 +17,8 @@
package com.android.quickstep.util
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.graphics.Bitmap
@@ -185,17 +187,32 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
}
}
/** Does not play any animation if user is not currently in split selection state. */
fun playPlaceholderDismissAnim(launcher: Launcher) {
if (!splitSelectStateController.isSplitSelectActive) {
return
}
fun animateAwayPlaceholder(mLauncher: Launcher) : AnimatorSet {
val anim = createPlaceholderDismissAnim(launcher)
anim.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
splitSelectStateController.resetState()
}
})
anim.start()
}
/** Returns [AnimatorSet] which slides initial split placeholder view offscreen. */
fun createPlaceholderDismissAnim(launcher: Launcher) : AnimatorSet {
val animatorSet = AnimatorSet()
val recentsView : RecentsView<*, *> = mLauncher.getOverviewPanel()
val recentsView : RecentsView<*, *> = launcher.getOverviewPanel()
val floatingTask: FloatingTaskView = splitSelectStateController.firstFloatingTaskView
?: return animatorSet
// We are in split selection state currently, transitioning to another state
val dragLayer: DragLayer = mLauncher.dragLayer
val dragLayer: DragLayer = launcher.dragLayer
val onScreenRectF = RectF()
Utilities.getBoundsForViewInDragLayer(mLauncher.dragLayer, floatingTask,
Utilities.getBoundsForViewInDragLayer(launcher.dragLayer, floatingTask,
Rect(0, 0, floatingTask.width, floatingTask.height),
false, null, onScreenRectF)
// Get the part of the floatingTask that intersects with the DragLayer (i.e. the
@@ -214,7 +231,7 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
floatingTask,
onScreenRectF,
floatingTask.stagePosition,
mLauncher.deviceProfile
launcher.deviceProfile
)))
return animatorSet
}