From a717d1621d186688e5b9919fb992d8c4af1fe385 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Thu, 5 May 2022 13:34:09 +0100 Subject: [PATCH] Allow BaseState.getTransitionDuration to read DeviceProfile - Changed handheld duration to AllApps to 600 Bug: 227745955 Test: manual Change-Id: I6f6642440dda3e39947231c2d38e8b60d152e08f --- .../taskbar/allapps/TaskbarAllAppsSlideInView.java | 5 +++-- .../launcher3/uioverrides/states/AllAppsState.java | 8 ++++++-- .../src/com/android/quickstep/views/RecentsView.java | 2 +- src/com/android/launcher3/statemanager/BaseState.java | 4 +++- .../launcher3/uioverrides/states/AllAppsState.java | 8 ++++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index 2d7ce3245a..c4837a0c51 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -62,7 +62,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView + int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) { + return !context.getDeviceProfile().isTablet && isToState + ? 600 + : isToState ? 500 : 300; } @Override diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 72f422128f..d4c5b8f1e5 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4051,7 +4051,7 @@ public abstract class RecentsView { /** * @return How long the animation to this state should take (or from this state to NORMAL). */ - int getTransitionDuration(Context context, boolean isToState); + + int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState); /** * Returns the state to go back to from this state diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java index 2f8e6806e0..52a67593ca 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java @@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP import android.content.Context; +import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; @@ -39,8 +40,11 @@ public class AllAppsState extends LauncherState { } @Override - public int getTransitionDuration(Context context, boolean isToState) { - return isToState ? 500 : 300; + public + int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) { + return !context.getDeviceProfile().isTablet && isToState + ? 600 + : isToState ? 500 : 300; } @Override