diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.kt b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.kt index c8f46a9dd7..cca8bf8e17 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.kt +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.kt @@ -20,6 +20,7 @@ import com.android.app.animation.Interpolators.AGGRESSIVE_EASE_IN_OUT import com.android.app.animation.Interpolators.FINAL_FRAME import com.android.app.animation.Interpolators.INSTANT import com.android.app.animation.Interpolators.LINEAR +import com.android.launcher3.Flags.enableDesktopExplodedView import com.android.launcher3.Flags.enableLargeDesktopWindowingTile import com.android.launcher3.LauncherState import com.android.launcher3.anim.AnimatedFloat @@ -51,6 +52,7 @@ import com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION import com.android.quickstep.views.RecentsView.TASK_SECONDARY_SPLIT_TRANSLATION import com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION import com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA +import com.android.quickstep.views.RecentsViewUtils.Companion.DESK_EXPLODE_PROGRESS import com.android.quickstep.views.TaskView.Companion.FLAG_UPDATE_ALL /** @@ -74,6 +76,13 @@ class RecentsViewStateController(private val launcher: QuickstepLauncher) : recentsView, if (state.displayOverviewTasksAsGrid(launcher.deviceProfile)) 1f else 0f, ) + if (enableDesktopExplodedView()) { + DESK_EXPLODE_PROGRESS.set( + recentsView, + if (state.displayOverviewTasksAsGrid(launcher.deviceProfile)) 1f else 0f, + ) + } + TASK_THUMBNAIL_SPLASH_ALPHA.set( recentsView, if (state.showTaskThumbnailSplash()) 1f else 0f, @@ -156,6 +165,15 @@ class RecentsViewStateController(private val launcher: QuickstepLauncher) : getOverviewInterpolator(fromState, toState), ) + if (enableDesktopExplodedView()) { + builder.setFloat( + recentsView, + DESK_EXPLODE_PROGRESS, + if (toState.isRecentsViewVisible) 1f else 0f, + getOverviewInterpolator(fromState, toState), + ) + } + if (enableLargeDesktopWindowingTile()) { builder.setFloat( recentsView, diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index b4b80c5705..56dd696550 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -18,6 +18,7 @@ package com.android.quickstep.fallback; import static com.android.app.animation.Interpolators.FINAL_FRAME; import static com.android.app.animation.Interpolators.INSTANT; import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.launcher3.Flags.enableDesktopExplodedView; import static com.android.launcher3.Flags.enableLargeDesktopWindowingTile; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; @@ -36,6 +37,7 @@ import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLA import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_SPLIT_TRANSLATION; import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION; import static com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA; +import static com.android.quickstep.views.RecentsViewUtils.DESK_EXPLODE_PROGRESS; import static com.android.quickstep.views.TaskView.FLAG_UPDATE_ALL; import android.util.FloatProperty; @@ -123,6 +125,10 @@ public class FallbackRecentsStateController implements StateHandler explodeProgress = progress }.animateToValue(0.0f, 1.0f) - private fun positionTaskWindows() { if (taskContainers.isEmpty()) { return diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 1ca14a5dae..9e53f11679 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -73,6 +73,7 @@ import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_RO import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_RECENTS; import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_TASKS; import static com.android.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SELECT_ACTIVE; +import static com.android.quickstep.views.RecentsViewUtils.DESK_EXPLODE_PROGRESS; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -2911,13 +2912,15 @@ public abstract class RecentsView< } if (enableDesktopExplodedView()) { + if (animatorSet == null) { + mUtils.setDeskExplodeProgress(1); + } else { + animatorSet.play( + ObjectAnimator.ofFloat(this, DESK_EXPLODE_PROGRESS, 1)); + } + for (TaskView taskView : getTaskViews()) { if (taskView instanceof DesktopTaskView desktopTaskView) { - if (animatorSet == null) { - desktopTaskView.setExplodeProgress(1.0f); - } else { - animatorSet.play(desktopTaskView.startWindowExplodeAnimation()); - } desktopTaskView.setRemoteTargetHandles(remoteTargetHandles); } } diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewUtils.kt b/quickstep/src/com/android/quickstep/views/RecentsViewUtils.kt index f742ec3898..8df743053c 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsViewUtils.kt +++ b/quickstep/src/com/android/quickstep/views/RecentsViewUtils.kt @@ -17,6 +17,7 @@ package com.android.quickstep.views import android.graphics.Rect +import android.util.FloatProperty import android.view.View import androidx.core.view.children import com.android.launcher3.Flags.enableLargeDesktopWindowingTile @@ -294,7 +295,24 @@ class RecentsViewUtils(private val recentsView: RecentsView<*, *>) { } } + var deskExplodeProgress: Float = 0f + set(value) { + field = value + taskViews.filterIsInstance().forEach { it.explodeProgress = field } + } + companion object { + @JvmField + val DESK_EXPLODE_PROGRESS = + object : FloatProperty>("deskExplodeProgress") { + override fun setValue(recentsView: RecentsView<*, *>, value: Float) { + recentsView.mUtils.deskExplodeProgress = value + } + + override fun get(recentsView: RecentsView<*, *>) = + recentsView.mUtils.deskExplodeProgress + } + val TEMP_RECT = Rect() } }