From 53d750e4270c36f42191d4b359ea562977675b74 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Tue, 23 Aug 2022 20:39:05 +0100 Subject: [PATCH 1/5] Launch tasks before testing switch to overview. Bug: 238461210 Test: TaplTestsQuickstep#testSwitchToOverview Change-Id: I0033b8b33371a01165c595ae66826bef5699eddb --- .../tests/src/com/android/quickstep/TaplTestsQuickstep.java | 1 + 1 file changed, 1 insertion(+) diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 159b65fcd3..42e9be32e3 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -229,6 +229,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @PortraitLandscape @ScreenRecord // b/238461765 public void testSwitchToOverview() throws Exception { + startTestAppsWithCheck(); assertNotNull("Workspace.switchToOverview() returned null", mLauncher.goHome().switchToOverview()); assertTrue("Launcher internal state didn't switch to Overview", From 2303eb0aacbb1b8dc0aa41b638a335f995376bec Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Wed, 13 Jul 2022 17:57:27 -0400 Subject: [PATCH 2/5] Simplify calculateEndTarget logic. This method has grown quite large and has a lot of if-else nesting. We can address these readability issues by defining some helper methods for specific cases (e.g. flingY and non-fling). Bug: 222117127 Test: Manual Change-Id: Ia6012dbcee9a842b4b5bd2ffdb9aea978cfdfc26 --- .../android/quickstep/AbsSwipeUpHandler.java | 132 ++++++++++-------- 1 file changed, 72 insertions(+), 60 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 8dee10aa53..4ac816f8b4 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1027,77 +1027,89 @@ public abstract class AbsSwipeUpHandler, return false; } - private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, - boolean isFlingY, boolean isCancel) { + private GestureEndTarget calculateEndTarget( + PointF velocity, float endVelocity, boolean isFlingY, boolean isCancel) { + if (mGestureState.isHandlingAtomicEvent()) { - // Button mode, this is only used to go to recents + // Button mode, this is only used to go to recents. return RECENTS; } - final GestureEndTarget endTarget; - final boolean goingToNewTask; - if (mRecentsView != null) { - if (!hasTargets()) { - // If there are no running tasks, then we can assume that this is a continuation of - // the last gesture, but after the recents animation has finished - goingToNewTask = true; - } else { - final int runningTaskIndex = mRecentsView.getRunningTaskIndex(); - final int taskToLaunch = mRecentsView.getNextPage(); - goingToNewTask = runningTaskIndex >= 0 && taskToLaunch != runningTaskIndex; - } - } else { - goingToNewTask = false; - } - final boolean reachedOverviewThreshold = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; - final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources() - .getDimension(R.dimen.quickstep_fling_threshold_speed); - if (!isFlingY) { - if (isCancel) { - endTarget = LAST_TASK; - } else if (mDeviceState.isFullyGesturalNavMode()) { - if (goingToNewTask && isFlingX) { - // Flinging towards new task takes precedence over mIsMotionPaused (which only - // checks y-velocity). - endTarget = NEW_TASK; - } else if (mIsMotionPaused) { - endTarget = RECENTS; - } else if (goingToNewTask) { - endTarget = NEW_TASK; - } else { - endTarget = !reachedOverviewThreshold ? LAST_TASK : HOME; - } - } else { - endTarget = reachedOverviewThreshold && mGestureStarted - ? RECENTS - : goingToNewTask - ? NEW_TASK - : LAST_TASK; - } - } else { - // If swiping at a diagonal, base end target on the faster velocity. - boolean isSwipeUp = endVelocity < 0; - boolean willGoToNewTaskOnSwipeUp = - goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity); - if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !willGoToNewTaskOnSwipeUp) { - endTarget = HOME; - } else if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp) { - // If swiping at a diagonal, base end target on the faster velocity. - endTarget = NEW_TASK; - } else if (isSwipeUp) { - endTarget = !reachedOverviewThreshold && willGoToNewTaskOnSwipeUp - ? NEW_TASK : RECENTS; - } else { - endTarget = goingToNewTask ? NEW_TASK : LAST_TASK; - } + GestureEndTarget endTarget; + if (isCancel) { + endTarget = LAST_TASK; + } else if (isFlingY) { + endTarget = calculateEndTargetForFlingY(velocity, endVelocity); + } else { + endTarget = calculateEndTargetForNonFling(velocity); } - if (mDeviceState.isOverviewDisabled() && (endTarget == RECENTS || endTarget == LAST_TASK)) { + if (mDeviceState.isOverviewDisabled() && endTarget == RECENTS) { return LAST_TASK; } + return endTarget; } + private GestureEndTarget calculateEndTargetForFlingY(PointF velocity, float endVelocity) { + final boolean isScrollingToNewTask = isScrollingToNewTask(); + final boolean isSwipeUp = endVelocity < 0; + if (!isSwipeUp) { + return isScrollingToNewTask ? NEW_TASK : LAST_TASK; + } + + // If swiping upward at a diagonal, base end target on the faster velocity direction. + boolean willGoToNewTask = + isScrollingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity); + if (!mDeviceState.isFullyGesturalNavMode()) { + return (!hasReachedOverviewThreshold() && willGoToNewTask) ? NEW_TASK : RECENTS; + } + return willGoToNewTask ? NEW_TASK : HOME; + } + + private GestureEndTarget calculateEndTargetForNonFling(PointF velocity) { + final boolean isScrollingToNewTask = isScrollingToNewTask(); + final boolean reachedOverviewThreshold = hasReachedOverviewThreshold(); + if (!mDeviceState.isFullyGesturalNavMode()) { + return reachedOverviewThreshold && mGestureStarted + ? RECENTS + : (isScrollingToNewTask ? NEW_TASK : LAST_TASK); + } + + // Fully gestural mode. + final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources() + .getDimension(R.dimen.quickstep_fling_threshold_speed); + if (isScrollingToNewTask && isFlingX) { + // Flinging towards new task takes precedence over mIsMotionPaused (which only + // checks y-velocity). + return NEW_TASK; + } else if (mIsMotionPaused) { + return RECENTS; + } else if (isScrollingToNewTask) { + return NEW_TASK; + } else if (reachedOverviewThreshold) { + return HOME; + } + return LAST_TASK; + } + + private boolean isScrollingToNewTask() { + if (mRecentsView == null) { + return false; + } + if (!hasTargets()) { + // If there are no running tasks, then we can assume that this is a continuation of + // the last gesture, but after the recents animation has finished. + return true; + } + int runningTaskIndex = mRecentsView.getRunningTaskIndex(); + return runningTaskIndex >= 0 && mRecentsView.getNextPage() != runningTaskIndex; + } + + private boolean hasReachedOverviewThreshold() { + return mCurrentShift.value > MIN_PROGRESS_FOR_OVERVIEW; + } + @UiThread private void handleNormalGestureEnd(float endVelocity, boolean isFling, PointF velocity, boolean isCancel) { From 47558a6201f4acf075eda09cc2ea210dcfd4d191 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Wed, 24 Aug 2022 14:33:27 -0700 Subject: [PATCH 3/5] Adding flag to improve the icons reordering on foldables Test: compiles Bug: 188081026 Change-Id: Ifa30bbc9ff38f2cc0f9530f3e075b5eb662f63eb Merged-In: Ifa30bbc9ff38f2cc0f9530f3e075b5eb662f63eb --- src/com/android/launcher3/config/FeatureFlags.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 49466adb38..005973c06b 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -272,6 +272,10 @@ public final class FeatureFlags { public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag( "CONTINUOUS_VIEW_TREE_CAPTURE", false, "Capture View tree every frame"); + public static final BooleanFlag FOLDABLE_WORKSPACE_REORDER = getDebugFlag( + "FOLDABLE_WORKSPACE_REORDER", true, + "In foldables, when reordering the icons and widgets, is now going to use both sides"); + public static void initialize(Context context) { synchronized (sDebugFlags) { for (DebugFlag flag : sDebugFlags) { From bf520a5935edc3e3a377ef04840222f70ae86a24 Mon Sep 17 00:00:00 2001 From: Sukesh Ram Date: Mon, 23 May 2022 22:36:51 +0000 Subject: [PATCH 4/5] Added margin of size 24dp above search bar on secondary display Test: Manual Change-Id: I5debc810385eced54aaed436489b16f36367194c (cherry picked from commit 958dcd2f4fb16452cf0b10af72db266b49da07a9) Bug: 244224274 --- res/layout/secondary_launcher.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml index 021325549b..272d8d6c5f 100644 --- a/res/layout/secondary_launcher.xml +++ b/res/layout/secondary_launcher.xml @@ -113,6 +113,7 @@ android:layout_height="@dimen/all_apps_search_bar_field_height" android:layout_centerHorizontal="true" android:layout_gravity="top|center_horizontal" + android:layout_marginTop="24dp" android:background="@drawable/bg_all_apps_searchbox" android:elevation="1dp" android:focusableInTouchMode="true" From 81dc9ad1318aa16f52ad7b9c3b5964fd28d4b513 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Wed, 24 Aug 2022 10:55:16 +0100 Subject: [PATCH 5/5] Refactor overview progress as splash progress. This also avoids showing splash in split select state Fix: 242284413 Test: follow up after b/238405972 Change-Id: I2e83fa3d030e8a74edb4152c472dbf02ac5a80b1 --- .../BaseRecentsViewStateController.java | 23 +++++++---- .../states/BackgroundAppState.java | 5 +++ .../NoButtonQuickSwitchTouchController.java | 2 + .../FallbackRecentsStateController.java | 6 +-- .../quickstep/fallback/RecentsState.java | 9 ++++- .../quickstep/views/GroupedTaskView.java | 2 +- .../android/quickstep/views/RecentsView.java | 39 ++++++++++--------- .../com/android/quickstep/views/TaskView.java | 13 +++---- .../launcher3/statemanager/BaseState.java | 7 ++++ 9 files changed, 67 insertions(+), 39 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index ea0972f293..555abe3f08 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -30,15 +30,16 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TR import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET; import static com.android.quickstep.views.RecentsView.FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN; -import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS; import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; import static com.android.quickstep.views.RecentsView.SPLIT_INSTRUCTIONS_FADE; import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION; +import static com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA; import android.graphics.Rect; import android.graphics.RectF; import android.util.FloatProperty; +import android.view.animation.Interpolator; import androidx.annotation.NonNull; @@ -79,7 +80,7 @@ public abstract class BaseRecentsViewStateController getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness()); RECENTS_GRID_PROGRESS.set(mRecentsView, state.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f); - OVERVIEW_PROGRESS.set(mRecentsView, state == LauncherState.OVERVIEW ? 1f : 0f); + TASK_THUMBNAIL_SPLASH_ALPHA.set(mRecentsView, state.showTaskThumbnailSplash() ? 1f : 0f); } @Override @@ -158,13 +159,19 @@ public abstract class BaseRecentsViewStateController mRecentsView, getTaskModalnessProperty(), toState.getOverviewModalness(), config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR)); - boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()); - setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f, - showAsGrid ? INSTANT : FINAL_FRAME); - boolean toOverview = toState == LauncherState.OVERVIEW; - setter.setFloat(mRecentsView, OVERVIEW_PROGRESS, toOverview ? 1f : 0f, - toOverview ? INSTANT : FINAL_FRAME); + LauncherState fromState = mLauncher.getStateManager().getState(); + setter.setFloat(mRecentsView, TASK_THUMBNAIL_SPLASH_ALPHA, + toState.showTaskThumbnailSplash() ? 1f : 0f, + !toState.showTaskThumbnailSplash() && fromState == LauncherState.QUICK_SWITCH + ? LINEAR : INSTANT); + + boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()); + Interpolator gridProgressInterpolator = showAsGrid + ? fromState == LauncherState.QUICK_SWITCH ? LINEAR : INSTANT + : FINAL_FRAME; + setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f, + gridProgressInterpolator); } abstract FloatProperty getTaskModalnessProperty(); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index b7330072d4..2eade67cc1 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -82,6 +82,11 @@ public class BackgroundAppState extends OverviewState { return false; } + @Override + public boolean showTaskThumbnailSplash() { + return true; + } + @Override protected float getDepthUnchecked(Context context) { return 1; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index bc76487cf8..eae096843e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -48,6 +48,7 @@ import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA; import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; 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.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import android.animation.Animator; @@ -225,6 +226,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, // Set RecentView's initial properties. RECENTS_SCALE_PROPERTY.set(mRecentsView, fromState.getOverviewScaleAndOffset(mLauncher)[0]); ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, 1f); + TASK_THUMBNAIL_SPLASH_ALPHA.set(mRecentsView, fromState.showTaskThumbnailSplash() ? 1f : 0); mRecentsView.setContentAlpha(1); mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress()); mLauncher.getActionsView().getVisibilityAlpha().setValue( diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index c7c3441acf..7337132a6a 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -27,13 +27,13 @@ import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT; import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET; import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS; -import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS; import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; import static com.android.quickstep.views.RecentsView.TASK_MODALNESS; import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION; 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.TaskView.FLAG_UPDATE_ALL; import android.util.FloatProperty; @@ -106,8 +106,8 @@ public class FallbackRecentsStateController implements StateHandler { private static final int FLAG_SCRIM = BaseState.getFlag(5); private static final int FLAG_LIVE_TILE = BaseState.getFlag(6); private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7); + private static final int FLAG_TASK_THUMBNAIL_SPLASH = BaseState.getFlag(8); public static final RecentsState DEFAULT = new RecentsState(0, FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID @@ -49,7 +50,8 @@ public class RecentsState implements BaseState { FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL | FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI); public static final RecentsState BACKGROUND_APP = new BackgroundAppState(2, - FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI); + FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI + | FLAG_TASK_THUMBNAIL_SPLASH); public static final RecentsState HOME = new RecentsState(3, 0); public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0); public static final RecentsState OVERVIEW_SPLIT_SELECT = new RecentsState(5, @@ -139,6 +141,11 @@ public class RecentsState implements BaseState { return hasFlag(FLAG_SHOW_AS_GRID) && deviceProfile.isTablet; } + @Override + public boolean showTaskThumbnailSplash() { + return hasFlag(FLAG_TASK_THUMBNAIL_SPLASH); + } + /** * True if the state has overview panel visible. */ diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index 2dff18e654..f718be884c 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -319,6 +319,6 @@ public class GroupedTaskView extends TaskView { protected void applyThumbnailSplashAlpha() { super.applyThumbnailSplashAlpha(); mSnapshotView2.setSplashAlpha( - Utilities.mapToRange(mOverviewProgress, 0f, 1f, 1f, 0f, LINEAR)); + Utilities.mapToRange(mTaskThumbnailSplashAlpha, 0f, 1f, 1f, 0f, LINEAR)); } } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 31c1bfcf53..69557a8103 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -381,19 +381,19 @@ public abstract class RecentsView OVERVIEW_PROGRESS = - new FloatProperty("overviewProgress") { + public static final FloatProperty TASK_THUMBNAIL_SPLASH_ALPHA = + new FloatProperty("taskThumbnailSplashAlpha") { @Override - public void setValue(RecentsView view, float overviewProgress) { - view.setOverviewProgress(overviewProgress); + public void setValue(RecentsView view, float taskThumbnailSplashAlpha) { + view.setTaskThumbnailSplashAlpha(taskThumbnailSplashAlpha); } @Override public Float get(RecentsView view) { - return view.mOverviewProgress; + return view.mTaskThumbnailSplashAlpha; } }; @@ -520,7 +520,7 @@ public abstract class RecentsView endState = mSizeStrategy.stateFromGestureEndTarget(endTarget); + if (endState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile())) { TaskView runningTaskView = getRunningTaskView(); float runningTaskPrimaryGridTranslation = 0; if (runningTaskView != null) { @@ -2268,11 +2269,12 @@ public abstract class RecentsViewUpdates the alpha of any splash screen over the thumbnail if it exists. + * Updates alpha of task thumbnail splash on swipe up/down. */ - public void setOverviewProgress(float overviewProgress) { - mOverviewProgress = overviewProgress; + public void setTaskThumbnailSplashAlpha(float taskThumbnailSplashAlpha) { + mTaskThumbnailSplashAlpha = taskThumbnailSplashAlpha; applyThumbnailSplashAlpha(); } protected void applyThumbnailSplashAlpha() { - mSnapshotView.setSplashAlpha( - Utilities.mapToRange(mOverviewProgress, 0f, 1f, 1f, 0f, LINEAR)); + mSnapshotView.setSplashAlpha(Utilities.boundToRange(mTaskThumbnailSplashAlpha, 0f, 1f)); } private void setSplitSelectTranslationX(float x) { diff --git a/src/com/android/launcher3/statemanager/BaseState.java b/src/com/android/launcher3/statemanager/BaseState.java index f9a36ad17c..32378b8384 100644 --- a/src/com/android/launcher3/statemanager/BaseState.java +++ b/src/com/android/launcher3/statemanager/BaseState.java @@ -63,4 +63,11 @@ public interface BaseState { default boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) { return false; } + + /** + * For this state, whether tasks should show the thumbnail splash. + */ + default boolean showTaskThumbnailSplash() { + return false; + } }