From 162ed05ac99a50bdbaa28ef654068bf593eebace Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Fri, 26 Feb 2021 23:51:30 -0800 Subject: [PATCH] Add NavigationModeFeatureFlag 3 Button mode doesn't use recents animation so live tile would not work on 3 button mode before migration to recents animation happens. Bug: 169694902 Test: manual Change-Id: I9574c624f3d220834fa18e910637cd64460adb0c --- .../NavBarToHomeTouchController.java | 6 +- .../android/quickstep/AbsSwipeUpHandler.java | 16 ++--- .../QuickstepProcessInitializer.java | 4 ++ .../android/quickstep/TaskOverlayFactory.java | 4 +- .../com/android/quickstep/TaskViewUtils.java | 9 ++- .../quickstep/TouchInteractionService.java | 8 +-- .../inputconsumers/OverviewInputConsumer.java | 4 +- .../util/NavigationModeFeatureFlag.java | 58 +++++++++++++++++++ .../quickstep/util/TaskViewSimulator.java | 3 +- .../quickstep/views/LauncherRecentsView.java | 4 +- .../android/quickstep/views/RecentsView.java | 24 ++++---- .../android/quickstep/views/TaskMenuView.java | 4 +- .../quickstep/views/TaskThumbnailView.java | 4 +- .../com/android/quickstep/views/TaskView.java | 6 +- 14 files changed, 107 insertions(+), 47 deletions(-) create mode 100644 quickstep/src/com/android/quickstep/util/NavigationModeFeatureFlag.java diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java index 6b9c34028a..a990f3ed93 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java @@ -24,8 +24,8 @@ import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_EDU; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; import android.animation.ValueAnimator; @@ -145,7 +145,7 @@ public class NavBarToHomeTouchController implements TouchController, OverviewScrim.SCRIM_MULTIPLIER, OVERVIEW_TO_HOME_SCRIM_MULTIPLIER, PULLBACK_INTERPOLATOR); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { builder.addOnFrameCallback(recentsView::redrawLiveTile); } @@ -194,7 +194,7 @@ public class NavBarToHomeTouchController implements TouchController, boolean success = interpolatedProgress >= SUCCESS_TRANSITION_PROGRESS || (velocity < 0 && fling); if (success) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.switchToScreenshot(null, () -> recentsView.finishRecentsAnimation(true /* toRecents */, null)); diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 1bd7fe6593..615d0fe2bc 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -25,7 +25,6 @@ import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAG import static com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; @@ -45,6 +44,7 @@ import static com.android.quickstep.GestureState.STATE_END_TARGET_ANIMATION_FINI import static com.android.quickstep.GestureState.STATE_END_TARGET_SET; import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED; import static com.android.quickstep.MultiStateCallback.DEBUG_STATES; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS; import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; @@ -318,7 +318,7 @@ public abstract class AbsSwipeUpHandler, Q extends mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_FINISH_WITH_NO_END, this::notifyTransitionCancelled); - if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (!LIVE_TILE.get()) { mStateCallback.addChangeListener(STATE_APP_CONTROLLER_RECEIVED | STATE_LAUNCHER_PRESENT | STATE_SCREENSHOT_VIEW_SHOWN | STATE_CAPTURE_SCREENSHOT, (b) -> mRecentsView.setRunningTaskHidden(!b)); @@ -459,7 +459,7 @@ public abstract class AbsSwipeUpHandler, Q extends } private void onDeferredActivityLaunch() { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { mActivityInterface.switchRunningTaskViewToScreenshot( null, () -> { mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); @@ -1366,7 +1366,7 @@ public abstract class AbsSwipeUpHandler, Q extends private void resetLauncherListenersAndOverlays() { // Reset the callback for deferred activity launches - if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (!LIVE_TILE.get()) { mActivityInterface.setOnDeferredActivityLaunchCallback(null); } mActivity.getRootView().setOnApplyWindowInsetsListener(null); @@ -1387,7 +1387,7 @@ public abstract class AbsSwipeUpHandler, Q extends protected void switchToScreenshot() { final int runningTaskId = mGestureState.getRunningTaskId(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { if (mRecentsAnimationController != null) { mRecentsAnimationController.getController().setWillFinishToHome(true); // Update the screenshot of the task @@ -1456,7 +1456,7 @@ public abstract class AbsSwipeUpHandler, Q extends } private void finishCurrentTransitionToRecents() { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); } else if (!hasTargets() || mRecentsAnimationController == null) { // If there are no targets or the animation not started, then there is nothing to finish @@ -1517,7 +1517,7 @@ public abstract class AbsSwipeUpHandler, Q extends endLauncherTransitionController(); mActivityInterface.onSwipeUpToRecentsComplete(); mRecentsView.onSwipeUpAnimationSuccess(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { mTaskAnimationManager.setLaunchOtherTaskInLiveTileModeHandler( appearedTaskTarget -> { RemoteAnimationTargetCompat[] apps = Arrays.copyOf( @@ -1765,7 +1765,7 @@ public abstract class AbsSwipeUpHandler, Q extends } mTaskViewSimulator.apply(mTransformParams); } - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mRecentsAnimationTargets != null) { + if (LIVE_TILE.get() && mRecentsAnimationTargets != null) { LiveTileOverlay.INSTANCE.update( mTaskViewSimulator.getCurrentRect(), mTaskViewSimulator.getCurrentCornerRadius()); diff --git a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java index 65847f11bb..192738f76a 100644 --- a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java +++ b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java @@ -15,6 +15,8 @@ */ package com.android.quickstep; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; + import android.annotation.TargetApi; import android.content.Context; import android.content.pm.PackageManager; @@ -59,6 +61,8 @@ public class QuickstepProcessInitializer extends MainProcessInitializer { super.init(context); + LIVE_TILE.initialize(context); + // Elevate GPU priority for Quickstep and Remote animations. ThreadedRendererCompat.setContextPriority( ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG); diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java index 0d2c42e3b0..8636130fd1 100644 --- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java @@ -18,7 +18,7 @@ package com.android.quickstep; import static android.view.Surface.ROTATION_0; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBNAIL; import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED; @@ -163,7 +163,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride { * @param callback callback to run, after switching to screenshot */ public void endLiveTileMode(@NonNull Runnable callback) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView(); recentsView.switchToScreenshot( () -> recentsView.finishRecentsAnimation(true /* toRecents */, callback)); diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index cd4f52f576..39751c0d71 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -23,8 +23,8 @@ import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncest import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; import static com.android.launcher3.anim.Interpolators.clampToProgress; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.statehandlers.DepthController.DEPTH; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; @@ -139,7 +139,7 @@ public final class TaskViewUtils { boolean isRunningTask = v.isRunningTask(); TransformParams params = null; TaskViewSimulator tsv = null; - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask) { + if (LIVE_TILE.get() && isRunningTask) { params = v.getRecentsView().getLiveTileParams(); tsv = v.getRecentsView().getLiveTileTaskViewSimulator(); } @@ -159,8 +159,7 @@ public final class TaskViewUtils { boolean isQuickSwitch = v.isEndQuickswitchCuj(); v.setEndQuickswitchCuj(false); - boolean inLiveTileMode = - ENABLE_QUICKSTEP_LIVE_TILE.get() && v.getRecentsView().getRunningTaskIndex() != -1; + boolean inLiveTileMode = LIVE_TILE.get() && v.getRecentsView().getRunningTaskIndex() != -1; final RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, wallpaperTargets, inLiveTileMode ? MODE_CLOSING : MODE_OPENING); @@ -341,7 +340,7 @@ public final class TaskViewUtils { }; } pa.add(launcherAnim); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) { + if (LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) { pa.addOnFrameCallback(recentsView::redrawLiveTile); } anim.play(pa.buildAnim()); diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 27c7ade603..fc805d0794 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -21,9 +21,9 @@ import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.config.FeatureFlags.ASSISTANT_GIVES_LAUNCHER_FOCUS; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.quickstep.GestureState.DEFAULT_STATE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED; @@ -687,8 +687,7 @@ public class TouchInteractionService extends Service implements PluginListener> @Override public void onKeyEvent(KeyEvent ev) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { mActivity.dispatchKeyEvent(ev); } } diff --git a/quickstep/src/com/android/quickstep/util/NavigationModeFeatureFlag.java b/quickstep/src/com/android/quickstep/util/NavigationModeFeatureFlag.java new file mode 100644 index 0000000000..60c7add38f --- /dev/null +++ b/quickstep/src/com/android/quickstep/util/NavigationModeFeatureFlag.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.quickstep.util; + +import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; + +import android.content.Context; + +import com.android.quickstep.SysUINavigationMode; + +import java.util.function.Predicate; +import java.util.function.Supplier; + +/** A feature flag that listens to navigation mode changes. */ +public class NavigationModeFeatureFlag implements + SysUINavigationMode.NavigationModeChangeListener { + + public static final NavigationModeFeatureFlag LIVE_TILE = new NavigationModeFeatureFlag( + ENABLE_QUICKSTEP_LIVE_TILE::get, mode -> mode.hasGestures); + + private final Supplier mBasePredicate; + private final Predicate mModePredicate; + private boolean mSupported; + + private NavigationModeFeatureFlag(Supplier basePredicate, + Predicate modePredicate) { + mBasePredicate = basePredicate; + mModePredicate = modePredicate; + } + + public boolean get() { + return mBasePredicate.get() && mSupported; + } + + public void initialize(Context context) { + onNavigationModeChanged(SysUINavigationMode.INSTANCE.get(context).getMode()); + SysUINavigationMode.INSTANCE.get(context).addModeChangeListener(this); + } + + @Override + public void onNavigationModeChanged(SysUINavigationMode.Mode newMode) { + mSupported = mModePredicate.test(newMode); + } +} diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 8c98480963..584a284381 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -19,6 +19,7 @@ import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.states.RotationHelper.deltaRotation; import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation; import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; @@ -352,7 +353,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { .withCornerRadius(getCurrentCornerRadius()) .withShadowRadius(app.isTranslucent ? 0 : params.getShadowRadius()); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && params.getRecentsSurface() != null) { + if (LIVE_TILE.get() && params.getRecentsSurface() != null) { // When relativeLayer = 0, it reverts the surfaces back to the original order. builder.withRelativeLayerTo(params.getRecentsSurface(), mDrawsBelowRecents ? Integer.MIN_VALUE : 0); diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java index 84218fd454..d99f707a68 100644 --- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java @@ -23,7 +23,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.SPRING_LOADED; import static com.android.launcher3.QuickstepAppTransitionManagerImpl.ALL_APPS_PROGRESS_OFF_SCREEN; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; @@ -95,7 +95,7 @@ public class LauncherRecentsView extends RecentsView public void startHome() { Runnable onReachedHome = () -> mActivity.getStateManager().goToState(NORMAL, false); OverviewToHomeAnim overviewToHomeAnim = new OverviewToHomeAnim(mActivity, onReachedHome); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { switchToScreenshot(null, () -> finishRecentsAnimation(true /* toRecents */, () -> overviewToHomeAnim.animateWithVelocity(0))); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index e20540c8fc..78910ceddd 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -35,7 +35,6 @@ import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; import static com.android.launcher3.anim.Interpolators.ACCEL_2; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_SWIPE_DOWN; @@ -43,6 +42,7 @@ import static com.android.launcher3.statehandlers.DepthController.DEPTH; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION; import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_RECENTS; import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_TASKS; @@ -561,7 +561,7 @@ public abstract class RecentsView extends PagedView @Override protected void onWindowVisibilityChanged(int visibility) { super.onWindowVisibilityChanged(visibility); - if (visibility != VISIBLE && ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (visibility != VISIBLE && LIVE_TILE.get()) { finishRecentsAnimation(true /* toRecents */, null); } updateTaskStackListenerState(); @@ -922,7 +922,7 @@ public abstract class RecentsView extends PagedView taskView.setModalness(mTaskModalness); } } - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { // Since we reuse the same mLiveTileTaskViewSimulator in the RecentsView, we need // to reset the params after it settles in Overview from swipe up so that we don't // render with obsolete param values. @@ -1042,7 +1042,7 @@ public abstract class RecentsView extends PagedView mModel.getThumbnailCache().getHighResLoadingState().setFlingingFast(isFlingingFast); mLiveTileTaskViewSimulator.setScroll(getScrollOffset()); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile + if (LIVE_TILE.get() && mEnableDrawingLiveTile && mLiveTileParams.getTargetSet() != null) { redrawLiveTile(); } @@ -1264,7 +1264,7 @@ public abstract class RecentsView extends PagedView */ public void onSwipeUpAnimationSuccess() { if (getRunningTaskView() != null) { - float startProgress = ENABLE_QUICKSTEP_LIVE_TILE.get() && mLiveTileOverlayAttached + float startProgress = LIVE_TILE.get() && mLiveTileOverlayAttached ? LiveTileOverlay.INSTANCE.cancelIconAnimation() : 0f; animateUpRunningTaskIconScale(startProgress); @@ -1326,7 +1326,7 @@ public abstract class RecentsView extends PagedView setOnScrollChangeListener(null); setEnableFreeScroll(true); setEnableDrawingLiveTile(true); - if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (!LIVE_TILE.get()) { setRunningTaskViewShowScreenshot(true); } setRunningTaskHidden(false); @@ -1418,7 +1418,7 @@ public abstract class RecentsView extends PagedView } private void setRunningTaskViewShowScreenshot(boolean showScreenshot) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { TaskView runningTaskView = getRunningTaskView(); if (runningTaskView != null) { runningTaskView.setShowScreenshot(showScreenshot); @@ -1824,7 +1824,7 @@ public abstract class RecentsView extends PagedView anim.addOnFrameCallback(this::updateCurveProperties); } - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRunningTaskView() == taskView) { + if (LIVE_TILE.get() && getRunningTaskView() == taskView) { anim.addOnFrameCallback(() -> { mLiveTileTaskViewSimulator.taskSecondaryTranslation.value = mOrientationHandler.getSecondaryValue( @@ -1843,7 +1843,7 @@ public abstract class RecentsView extends PagedView mPendingAnimation.addEndListener(new Consumer() { @Override public void accept(Boolean success) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && taskView.isRunningTask() && success) { + if (LIVE_TILE.get() && taskView.isRunningTask() && success) { finishRecentsAnimation(true /* toHome */, () -> onEnd(success)); } else { onEnd(success); @@ -2390,7 +2390,7 @@ public abstract class RecentsView extends PagedView anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex), mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation)); int runningTaskIndex = recentsView.getRunningTaskIndex(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && runningTaskIndex != -1 + if (LIVE_TILE.get() && runningTaskIndex != -1 && runningTaskIndex != taskIndex) { anim.play(ObjectAnimator.ofFloat( recentsView.getLiveTileTaskViewSimulator().taskPrimaryTranslation, @@ -2467,7 +2467,7 @@ public abstract class RecentsView extends PagedView mPendingAnimation = new PendingAnimation(duration); mPendingAnimation.add(anim); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { mLiveTileTaskViewSimulator.addOverviewToAppAnim(mPendingAnimation, interpolator); mPendingAnimation.addOnFrameCallback(this::redrawLiveTile); } @@ -2479,7 +2479,7 @@ public abstract class RecentsView extends PagedView tv.notifyTaskLaunchFailed(TAG); } }; - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { finishRecentsAnimation(false /* toRecents */, null); onLaunchResult.accept(true /* success */); } else { diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java index f477ca7ea9..2315147bdb 100644 --- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java +++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java @@ -16,7 +16,7 @@ package com.android.quickstep.views; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA; import android.animation.Animator; @@ -183,7 +183,7 @@ public class TaskMenuView extends AbstractFloatingView { LayoutParams lp = (LayoutParams) menuOptionView.getLayoutParams(); mTaskView.getPagedOrientationHandler().setLayoutParamsForTaskMenuOptionItem(lp); menuOptionView.setOnClickListener(view -> { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { + if (LIVE_TILE.get()) { RecentsView recentsView = mTaskView.getRecentsView(); recentsView.switchToScreenshot(null, () -> recentsView.finishRecentsAnimation(true /* toRecents */, diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index f2f4bc1238..4c21745de8 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -19,7 +19,7 @@ package com.android.quickstep.views; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; +import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; import android.content.Context; @@ -319,7 +319,7 @@ public class TaskThumbnailView extends View implements PluginListener { setIcon(task.icon); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) { + if (LIVE_TILE.get() && isRunningTask()) { getRecentsView().updateLiveTileIcon(task.icon); } mDigitalWellBeingToast.initialize(mTask);