diff --git a/quickstep/src/com/android/quickstep/views/IconAppChipView.kt b/quickstep/src/com/android/quickstep/views/IconAppChipView.kt index 85d14cc5ab..8d535524f5 100644 --- a/quickstep/src/com/android/quickstep/views/IconAppChipView.kt +++ b/quickstep/src/com/android/quickstep/views/IconAppChipView.kt @@ -296,7 +296,7 @@ constructor( fun getMenuTranslationY(): MultiPropertyFactory.MultiProperty = viewTranslationY[INDEX_MENU_TRANSLATION] - internal fun revealAnim(isRevealing: Boolean) { + internal fun revealAnim(isRevealing: Boolean, animated: Boolean = true) { cancelInProgressAnimations() val collapsedBackgroundBounds = getCollapsedBackgroundLtrBounds() val expandedBackgroundBounds = getExpandedBackgroundLtrBounds() @@ -392,6 +392,7 @@ constructor( animator!!.setDuration(MENU_BACKGROUND_HIDE_DURATION.toLong()) } + if (!animated) animator!!.duration = 0 animator!!.interpolator = Interpolators.EMPHASIZED animator!!.start() } diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.kt b/quickstep/src/com/android/quickstep/views/TaskMenuView.kt index 95336cfe19..4777f4f140 100644 --- a/quickstep/src/com/android/quickstep/views/TaskMenuView.kt +++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.kt @@ -75,7 +75,7 @@ constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int = 0) : if (ev.action == MotionEvent.ACTION_DOWN) { if (!recentsViewContainer.dragLayer.isEventOverView(this, ev)) { // TODO: log this once we have a new container type for it? - close(true) + animateOpenOrClosed(true) return true } } @@ -83,7 +83,7 @@ constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int = 0) : } override fun handleClose(animate: Boolean) { - animateClose() + animateOpenOrClosed(true, animated = false) } override fun isOfType(type: Int): Boolean = (type and TYPE_TASK_MENU) != 0 @@ -260,11 +260,7 @@ constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int = 0) : private val iconView: View get() = taskContainer.iconView.asView() - private fun animateClose() { - animateOpenOrClosed(true) - } - - private fun animateOpenOrClosed(closing: Boolean) { + private fun animateOpenOrClosed(closing: Boolean, animated: Boolean = true) { openCloseAnimator?.let { if (it.isRunning) it.cancel() } openCloseAnimator = AnimatorSet() // If we're opening, we just start from the beginning as a new `TaskMenuView` is created @@ -312,7 +308,12 @@ constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int = 0) : } } ) - val animationDuration = if (closing) REVEAL_CLOSE_DURATION else REVEAL_OPEN_DURATION + val animationDuration = + when { + animated && closing -> REVEAL_CLOSE_DURATION + animated && !closing -> REVEAL_OPEN_DURATION + else -> 0L + } openCloseAnimator!!.setDuration(animationDuration) openCloseAnimator!!.start() } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt index 27db6d6188..c5b8e8cca1 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.kt +++ b/quickstep/src/com/android/quickstep/views/TaskView.kt @@ -1476,7 +1476,8 @@ constructor( return if (enableOverviewIconMenu() && menuContainer.iconView is IconAppChipView) { menuContainer.iconView.revealAnim(/* isRevealing= */ true) TaskMenuView.showForTask(menuContainer) { - menuContainer.iconView.revealAnim(/* isRevealing= */ false) + val isAnimated = !recentsView.isSplitSelectionActive + menuContainer.iconView.revealAnim(/* isRevealing= */ false, isAnimated) if (enableHoverOfChildElementsInTaskview()) { recentsView.setTaskBorderEnabled(true) }