diff --git a/aconfig/launcher.aconfig b/aconfig/launcher.aconfig index 0855de741f..ef0e61a460 100644 --- a/aconfig/launcher.aconfig +++ b/aconfig/launcher.aconfig @@ -404,16 +404,6 @@ flag { bug: "292269949" } -flag { - name: "coordinate_workspace_scale" - namespace: "launcher" - description: "Ensure that the workspace and hotseat scale doesn't conflict and transitions smoothly between launching and closing apps" - bug: "366403487" - metadata { - purpose: PURPOSE_BUGFIX - } -} - flag { name: "enable_tiered_widgets_by_default_in_picker" namespace: "launcher" diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index d3cbca4460..3d65144648 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -182,7 +182,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; -import java.util.Map.Entry; /** * Manages the opening and closing app transitions from Launcher @@ -602,13 +601,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener endListener = composeViewContentAnimator(launcherAnimator, alphas, scales); } else { List viewsToAnimate = new ArrayList<>(); - Workspace workspace = mLauncher.getWorkspace(); - if (Flags.coordinateWorkspaceScale()) { - viewsToAnimate.add(workspace); - } else { - workspace.forEachVisiblePage( - view -> viewsToAnimate.add(((CellLayout) view).getShortcutsAndWidgets())); - } + viewsToAnimate.add(mLauncher.getWorkspace()); Hotseat hotseat = mLauncher.getHotseat(); // Do not scale hotseat as a whole when taskbar is present, and scale QSB only if it's @@ -624,22 +617,19 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener viewsToAnimate.forEach(view -> { view.setLayerType(View.LAYER_TYPE_HARDWARE, null); - float[] scale = scales; - if (Flags.coordinateWorkspaceScale()) { - // Start the animation from the current value, instead of assuming the views are - // in their resting state, so interrupted animations merge seamlessly. - // TODO(b/367591368): ideally these animations would be refactored to be - // controlled centrally so each instances doesn't need to care about this - // coordination. - scale = new float[]{view.getScaleX(), scales[1]}; + // Start the animation from the current value, instead of assuming the views are + // in their resting state, so interrupted animations merge seamlessly. + // TODO(b/367591368): ideally these animations would be refactored to be + // controlled centrally so each instances doesn't need to care about this + // coordination. + float[] scale = new float[]{view.getScaleX(), scales[1]}; - // Cancel any ongoing animations. This is necessary to avoid a conflict between - // e.g. the unfinished animation triggered when closing an app back to Home and - // this animation caused by a launch. - Animations.Companion.cancelOngoingAnimation(view); - // Make sure to cache the current animation, so it can be properly interrupted. - Animations.Companion.setOngoingAnimation(view, launcherAnimator); - } + // Cancel any ongoing animations. This is necessary to avoid a conflict between + // e.g. the unfinished animation triggered when closing an app back to Home and + // this animation caused by a launch. + Animations.Companion.cancelOngoingAnimation(view); + // Make sure to cache the current animation, so it can be properly interrupted. + Animations.Companion.setOngoingAnimation(view, launcherAnimator); ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(view, SCALE_PROPERTY, scale) .setDuration(CONTENT_SCALE_DURATION); @@ -652,10 +642,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener SCALE_PROPERTY.set(view, 1f); view.setLayerType(View.LAYER_TYPE_NONE, null); - if (Flags.coordinateWorkspaceScale()) { - // Reset the cached animation. - Animations.Companion.setOngoingAnimation(view, null /* animation */); - } + // Reset the cached animation. + Animations.Companion.setOngoingAnimation(view, null /* animation */); }); mLauncher.resumeExpensiveViewUpdates(); }; diff --git a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt index a5ef2c1b08..b1263ff441 100644 --- a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt +++ b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt @@ -29,7 +29,6 @@ import androidx.core.graphics.transform import com.android.app.animation.Animations import com.android.app.animation.Interpolators import com.android.app.animation.Interpolators.LINEAR -import com.android.launcher3.Flags import com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY import com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_WORKSPACE_STATE import com.android.launcher3.LauncherAnimUtils.WORKSPACE_SCALE_PROPERTY_FACTORY @@ -101,17 +100,13 @@ class ScalingWorkspaceRevealAnim( val workspace = launcher.workspace val hotseat = launcher.hotseat - var fromSize = - if (Flags.coordinateWorkspaceScale()) { - // Interrupt the current animation, if any. - Animations.cancelOngoingAnimation(workspace) - Animations.cancelOngoingAnimation(hotseat) + // Interrupt the current animation, if any. + Animations.cancelOngoingAnimation(workspace) + Animations.cancelOngoingAnimation(hotseat) - if (workspace.scaleX != MAX_SIZE) { - workspace.scaleX - } else { - MIN_SIZE - } + val fromSize = + if (workspace.scaleX != MAX_SIZE) { + workspace.scaleX } else { MIN_SIZE } @@ -228,11 +223,9 @@ class ScalingWorkspaceRevealAnim( workspace.setLayerType(View.LAYER_TYPE_NONE, null) hotseat.setLayerType(View.LAYER_TYPE_NONE, null) - if (Flags.coordinateWorkspaceScale()) { - // Reset the cached animations. - Animations.setOngoingAnimation(workspace, animation = null) - Animations.setOngoingAnimation(hotseat, animation = null) - } + // Reset the cached animations. + Animations.setOngoingAnimation(workspace, animation = null) + Animations.setOngoingAnimation(hotseat, animation = null) Log.d(TAG, "alpha of workspace at the end of animation: ${workspace.alpha}") } @@ -246,13 +239,11 @@ class ScalingWorkspaceRevealAnim( fun start() { val animators = getAnimators() - if (Flags.coordinateWorkspaceScale()) { - // Make sure to cache the current animation, so it can be properly interrupted. - // TODO(b/367591368): ideally these animations would be refactored to be controlled - // centrally so each instances doesn't need to care about this coordination. - Animations.setOngoingAnimation(launcher.workspace, animators) - Animations.setOngoingAnimation(launcher.hotseat, animators) - } + // Make sure to cache the current animation, so it can be properly interrupted. + // TODO(b/367591368): ideally these animations would be refactored to be controlled + // centrally so each instances doesn't need to care about this coordination. + Animations.setOngoingAnimation(launcher.workspace, animators) + Animations.setOngoingAnimation(launcher.hotseat, animators) launcher.stateManager.setCurrentAnimation(animators, LauncherState.NORMAL) animators.start() }