diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherState.java')
-rw-r--r-- | src/com/android/launcher3/LauncherState.java | 77 |
1 files changed, 14 insertions, 63 deletions
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java index ea6a9199d7..3399ce9cd6 100644 --- a/src/com/android/launcher3/LauncherState.java +++ b/src/com/android/launcher3/LauncherState.java @@ -16,7 +16,6 @@ package com.android.launcher3; import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; import static com.android.launcher3.testing.TestProtocol.ALL_APPS_STATE_ORDINAL; @@ -58,9 +57,10 @@ public abstract class LauncherState implements BaseState<LauncherState> { public static final int ALL_APPS_CONTENT = 1 << 1; public static final int VERTICAL_SWIPE_INDICATOR = 1 << 2; public static final int OVERVIEW_ACTIONS = 1 << 3; - public static final int CLEAR_ALL_BUTTON = 1 << 4; - public static final int WORKSPACE_PAGE_INDICATOR = 1 << 5; - public static final int SPLIT_PLACHOLDER_VIEW = 1 << 6; + public static final int TASKBAR = 1 << 4; + public static final int CLEAR_ALL_BUTTON = 1 << 5; + public static final int WORKSPACE_PAGE_INDICATOR = 1 << 6; + public static final int SPLIT_PLACHOLDER_VIEW = 1 << 7; // Flag indicating workspace has multiple pages visible. public static final int FLAG_MULTI_PAGE = BaseState.getFlag(0); @@ -80,9 +80,6 @@ public abstract class LauncherState implements BaseState<LauncherState> { public static final int FLAG_CLOSE_POPUPS = BaseState.getFlag(6); public static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7); - // Flag indicating that hotseat and its contents are not accessible. - public static final int FLAG_HOTSEAT_INACCESSIBLE = BaseState.getFlag(8); - public static final float NO_OFFSET = 0; public static final float NO_SCALE = 1; @@ -95,14 +92,6 @@ public abstract class LauncherState implements BaseState<LauncherState> { } }; - protected static final PageTranslationProvider DEFAULT_PAGE_TRANSLATION_PROVIDER = - new PageTranslationProvider(DEACCEL_2) { - @Override - public float getPageTranslation(int pageIndex) { - return 0; - } - }; - private static final LauncherState[] sAllStates = new LauncherState[10]; /** @@ -113,7 +102,7 @@ public abstract class LauncherState implements BaseState<LauncherState> { FLAG_DISABLE_RESTORE | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_HIDE_BACK_BUTTON | FLAG_HAS_SYS_UI_SCRIM) { @Override - public int getTransitionDuration(Context context, boolean isToState) { + public int getTransitionDuration(Context context) { // Arbitrary duration, when going to NORMAL we use the state we're coming from instead. return 0; } @@ -192,12 +181,20 @@ public abstract class LauncherState implements BaseState<LauncherState> { return launcher.getNormalOverviewScaleAndOffset(); } + public float getTaskbarScale(Launcher launcher) { + return launcher.getNormalTaskbarScale(); + } + + public float getTaskbarTranslationY(Launcher launcher) { + return -launcher.getHotseat().getTaskbarOffsetY(); + } + public float getOverviewFullscreenProgress() { return 0; } public int getVisibleElements(Launcher launcher) { - return HOTSEAT_ICONS | WORKSPACE_PAGE_INDICATOR | VERTICAL_SWIPE_INDICATOR; + return HOTSEAT_ICONS | WORKSPACE_PAGE_INDICATOR | VERTICAL_SWIPE_INDICATOR | TASKBAR; } /** @@ -208,16 +205,6 @@ public abstract class LauncherState implements BaseState<LauncherState> { return (getVisibleElements(launcher) & elements) == elements; } - /** Returns whether taskbar is stashed and thus should replace hotseat with a handle */ - public boolean isTaskbarStashed(Launcher launcher) { - return false; - } - - /** Returns whether taskbar is aligned with the hotseat vs position inside apps */ - public boolean isTaskbarAlignedWithHotseat(Launcher launcher) { - return !isTaskbarStashed(launcher); - } - /** * Fraction shift in the vertical translation UI and related properties * @@ -300,25 +287,6 @@ public abstract class LauncherState implements BaseState<LauncherState> { }; } - /** - * Gets the translation provider for workspace pages. - */ - public PageTranslationProvider getWorkspacePageTranslationProvider(Launcher launcher) { - if (this != SPRING_LOADED || !launcher.getDeviceProfile().isTwoPanels) { - return DEFAULT_PAGE_TRANSLATION_PROVIDER; - } - final float quarterPageSpacing = launcher.getWorkspace().getPageSpacing() / 4f; - return new PageTranslationProvider(DEACCEL_2) { - @Override - public float getPageTranslation(int pageIndex) { - boolean isRtl = launcher.getWorkspace().mIsRtl; - boolean isFirstPage = pageIndex % 2 == 0; - return ((isFirstPage && !isRtl) || (!isFirstPage && isRtl)) ? -quarterPageSpacing - : quarterPageSpacing; - } - }; - } - @Override public LauncherState getHistoryForState(LauncherState previousState) { // No history is supported @@ -349,23 +317,6 @@ public abstract class LauncherState implements BaseState<LauncherState> { public abstract float getPageAlpha(int pageIndex); } - /** - * Provider for the translation and animation interpolation of workspace pages. - */ - public abstract static class PageTranslationProvider { - - public final Interpolator interpolator; - - public PageTranslationProvider(Interpolator interpolator) { - this.interpolator = interpolator; - } - - /** - * Gets the translation of the workspace page at the provided page index. - */ - public abstract float getPageTranslation(int pageIndex); - } - public static class ScaleAndTranslation { public float scale; public float translationX; |