Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package com.android.launcher3; |
| 17 | |
| 18 | import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; |
| 19 | import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; |
Sunny Goyal | 3e3f44c | 2017-10-23 17:14:52 -0700 | [diff] [blame] | 20 | import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED; |
Vadim Tryshev | 1b0c503 | 2018-05-23 12:54:27 -0700 | [diff] [blame] | 21 | |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 22 | import static com.android.launcher3.anim.Interpolators.ACCEL_2; |
Sunny Goyal | 623eddd | 2018-03-02 12:24:41 -0800 | [diff] [blame] | 23 | import static com.android.launcher3.states.RotationHelper.REQUEST_NONE; |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 24 | |
Tony Wickham | 6becf7c | 2018-04-19 11:39:34 -0700 | [diff] [blame] | 25 | import android.graphics.Rect; |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 26 | import android.view.animation.Interpolator; |
Sunny Goyal | be93f26 | 2017-10-20 17:05:27 -0700 | [diff] [blame] | 27 | |
Sunny Goyal | c99cb17 | 2017-10-19 16:15:09 -0700 | [diff] [blame] | 28 | import com.android.launcher3.states.SpringLoadedState; |
Sunny Goyal | 623eddd | 2018-03-02 12:24:41 -0800 | [diff] [blame] | 29 | import com.android.launcher3.uioverrides.AllAppsState; |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 30 | import com.android.launcher3.uioverrides.FastOverviewState; |
Sunny Goyal | 8552517 | 2017-11-06 13:00:42 -0800 | [diff] [blame] | 31 | import com.android.launcher3.uioverrides.OverviewState; |
Sunny Goyal | 75c59ac | 2018-01-15 14:23:11 -0800 | [diff] [blame] | 32 | import com.android.launcher3.uioverrides.UiFactory; |
Sunny Goyal | e39690b | 2018-08-02 13:35:07 -0700 | [diff] [blame^] | 33 | import com.android.launcher3.userevent.nano.LauncherLogProto.Action; |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 34 | import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; |
| 35 | |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 36 | import java.util.Arrays; |
| 37 | |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 38 | |
| 39 | /** |
Sunny Goyal | be93f26 | 2017-10-20 17:05:27 -0700 | [diff] [blame] | 40 | * Base state for various states used for the Launcher |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 41 | */ |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 42 | public class LauncherState { |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 43 | |
Sunny Goyal | 7185dd6 | 2018-03-14 17:51:49 -0700 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Set of elements indicating various workspace elements which change visibility across states |
| 47 | * Note that workspace is not included here as in that case, we animate individual pages |
| 48 | */ |
| 49 | public static final int NONE = 0; |
Tony Wickham | bd6f05e | 2018-03-21 08:16:33 -0700 | [diff] [blame] | 50 | public static final int HOTSEAT_ICONS = 1 << 0; |
Sunny Goyal | 81b4c7b | 2018-03-26 12:10:31 -0700 | [diff] [blame] | 51 | public static final int HOTSEAT_SEARCH_BOX = 1 << 1; |
Tony Wickham | bd6f05e | 2018-03-21 08:16:33 -0700 | [diff] [blame] | 52 | public static final int ALL_APPS_HEADER = 1 << 2; |
| 53 | public static final int ALL_APPS_HEADER_EXTRA = 1 << 3; // e.g. app predictions |
| 54 | public static final int ALL_APPS_CONTENT = 1 << 4; |
Sunny Goyal | 56e1019 | 2018-05-22 13:22:25 -0700 | [diff] [blame] | 55 | public static final int VERTICAL_SWIPE_INDICATOR = 1 << 5; |
Sunny Goyal | 7185dd6 | 2018-03-14 17:51:49 -0700 | [diff] [blame] | 56 | |
Sunny Goyal | 927447e | 2018-05-04 13:19:29 -0700 | [diff] [blame] | 57 | protected static final int FLAG_MULTI_PAGE = 1 << 0; |
| 58 | protected static final int FLAG_DISABLE_ACCESSIBILITY = 1 << 1; |
| 59 | protected static final int FLAG_DISABLE_RESTORE = 1 << 2; |
| 60 | protected static final int FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED = 1 << 3; |
| 61 | protected static final int FLAG_DISABLE_PAGE_CLIPPING = 1 << 4; |
| 62 | protected static final int FLAG_PAGE_BACKGROUNDS = 1 << 5; |
| 63 | protected static final int FLAG_DISABLE_INTERACTION = 1 << 6; |
| 64 | protected static final int FLAG_OVERVIEW_UI = 1 << 7; |
| 65 | protected static final int FLAG_HIDE_BACK_BUTTON = 1 << 8; |
Sunny Goyal | 5d1873a | 2018-05-08 11:10:44 -0700 | [diff] [blame] | 66 | protected static final int FLAG_HAS_SYS_UI_SCRIM = 1 << 9; |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 67 | |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 68 | protected static final PageAlphaProvider DEFAULT_ALPHA_PROVIDER = |
| 69 | new PageAlphaProvider(ACCEL_2) { |
| 70 | @Override |
| 71 | public float getPageAlpha(int pageIndex) { |
| 72 | return 1; |
| 73 | } |
| 74 | }; |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 75 | |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 76 | private static final LauncherState[] sAllStates = new LauncherState[5]; |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 77 | |
Sunny Goyal | 75c59ac | 2018-01-15 14:23:11 -0800 | [diff] [blame] | 78 | /** |
| 79 | * TODO: Create a separate class for NORMAL state. |
| 80 | */ |
Sunny Goyal | 5d1873a | 2018-05-08 11:10:44 -0700 | [diff] [blame] | 81 | public static final LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE, 0, |
| 82 | FLAG_DISABLE_RESTORE | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_HIDE_BACK_BUTTON | |
| 83 | FLAG_HAS_SYS_UI_SCRIM); |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 84 | |
Sunny Goyal | 7185dd6 | 2018-03-14 17:51:49 -0700 | [diff] [blame] | 85 | /** |
| 86 | * Various Launcher states arranged in the increasing order of UI layers |
| 87 | */ |
| 88 | public static final LauncherState SPRING_LOADED = new SpringLoadedState(1); |
| 89 | public static final LauncherState OVERVIEW = new OverviewState(2); |
| 90 | public static final LauncherState FAST_OVERVIEW = new FastOverviewState(3); |
| 91 | public static final LauncherState ALL_APPS = new AllAppsState(4); |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 92 | |
Tony Wickham | 6becf7c | 2018-04-19 11:39:34 -0700 | [diff] [blame] | 93 | protected static final Rect sTempRect = new Rect(); |
| 94 | |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 95 | public final int ordinal; |
| 96 | |
Sunny Goyal | f9403d9 | 2017-10-18 10:55:56 -0700 | [diff] [blame] | 97 | /** |
| 98 | * Used for containerType in {@link com.android.launcher3.logging.UserEventDispatcher} |
| 99 | */ |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 100 | public final int containerType; |
| 101 | |
Sunny Goyal | f9403d9 | 2017-10-18 10:55:56 -0700 | [diff] [blame] | 102 | /** |
| 103 | * True if the state can be persisted across activity restarts. |
| 104 | */ |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 105 | public final boolean disableRestore; |
Sunny Goyal | f9403d9 | 2017-10-18 10:55:56 -0700 | [diff] [blame] | 106 | |
| 107 | /** |
| 108 | * True if workspace has multiple pages visible. |
| 109 | */ |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 110 | public final boolean hasMultipleVisiblePages; |
Sunny Goyal | f9403d9 | 2017-10-18 10:55:56 -0700 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * Accessibility flag for workspace and its pages. |
| 114 | * @see android.view.View#setImportantForAccessibility(int) |
| 115 | */ |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 116 | public final int workspaceAccessibilityFlag; |
| 117 | |
Sunny Goyal | be93f26 | 2017-10-20 17:05:27 -0700 | [diff] [blame] | 118 | /** |
| 119 | * Properties related to state transition animation |
| 120 | * |
| 121 | * @see WorkspaceStateTransitionAnimation |
| 122 | */ |
Sunny Goyal | 6639a5d | 2018-02-28 15:09:36 -0800 | [diff] [blame] | 123 | public final boolean hasWorkspacePageBackground; |
Sunny Goyal | 6639a5d | 2018-02-28 15:09:36 -0800 | [diff] [blame] | 124 | |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 125 | public final int transitionDuration; |
| 126 | |
Sunny Goyal | be93f26 | 2017-10-20 17:05:27 -0700 | [diff] [blame] | 127 | /** |
Tony Wickham | 5337067 | 2017-12-05 10:10:55 -0800 | [diff] [blame] | 128 | * True if the state allows workspace icons to be dragged. |
| 129 | */ |
| 130 | public final boolean workspaceIconsCanBeDragged; |
| 131 | |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 132 | /** |
| 133 | * True if the workspace pages should not be clipped relative to the workspace bounds |
| 134 | * for this state. |
| 135 | */ |
| 136 | public final boolean disablePageClipping; |
| 137 | |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 138 | /** |
| 139 | * True if launcher can not be directly interacted in this state; |
| 140 | */ |
| 141 | public final boolean disableInteraction; |
| 142 | |
| 143 | /** |
| 144 | * True if the state has overview panel visible. |
| 145 | */ |
| 146 | public final boolean overviewUi; |
| 147 | |
Tony Wickham | 76cf236 | 2018-03-20 14:13:16 -0700 | [diff] [blame] | 148 | /** |
| 149 | * True if the back button should be hidden when in this state (assuming no floating views are |
| 150 | * open, launcher has window focus, etc). |
| 151 | */ |
| 152 | public final boolean hideBackButton; |
| 153 | |
Sunny Goyal | 5d1873a | 2018-05-08 11:10:44 -0700 | [diff] [blame] | 154 | public final boolean hasSysUiScrim; |
| 155 | |
Sunny Goyal | 228153d | 2018-01-04 15:35:22 -0800 | [diff] [blame] | 156 | public LauncherState(int id, int containerType, int transitionDuration, int flags) { |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 157 | this.containerType = containerType; |
| 158 | this.transitionDuration = transitionDuration; |
| 159 | |
Sunny Goyal | 6639a5d | 2018-02-28 15:09:36 -0800 | [diff] [blame] | 160 | this.hasWorkspacePageBackground = (flags & FLAG_PAGE_BACKGROUNDS) != 0; |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 161 | this.hasMultipleVisiblePages = (flags & FLAG_MULTI_PAGE) != 0; |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 162 | this.workspaceAccessibilityFlag = (flags & FLAG_DISABLE_ACCESSIBILITY) != 0 |
| 163 | ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS |
| 164 | : IMPORTANT_FOR_ACCESSIBILITY_AUTO; |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 165 | this.disableRestore = (flags & FLAG_DISABLE_RESTORE) != 0; |
Tony Wickham | 5337067 | 2017-12-05 10:10:55 -0800 | [diff] [blame] | 166 | this.workspaceIconsCanBeDragged = (flags & FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED) != 0; |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 167 | this.disablePageClipping = (flags & FLAG_DISABLE_PAGE_CLIPPING) != 0; |
Sunny Goyal | 6c6c2f4 | 2018-03-02 14:57:46 -0800 | [diff] [blame] | 168 | this.disableInteraction = (flags & FLAG_DISABLE_INTERACTION) != 0; |
| 169 | this.overviewUi = (flags & FLAG_OVERVIEW_UI) != 0; |
Tony Wickham | 76cf236 | 2018-03-20 14:13:16 -0700 | [diff] [blame] | 170 | this.hideBackButton = (flags & FLAG_HIDE_BACK_BUTTON) != 0; |
Sunny Goyal | 5d1873a | 2018-05-08 11:10:44 -0700 | [diff] [blame] | 171 | this.hasSysUiScrim = (flags & FLAG_HAS_SYS_UI_SCRIM) != 0; |
Sunny Goyal | cd7c0aa | 2017-10-19 12:36:27 -0700 | [diff] [blame] | 172 | |
| 173 | this.ordinal = id; |
| 174 | sAllStates[id] = this; |
| 175 | } |
| 176 | |
| 177 | public static LauncherState[] values() { |
| 178 | return Arrays.copyOf(sAllStates, sAllStates.length); |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 179 | } |
Sunny Goyal | c99cb17 | 2017-10-19 16:15:09 -0700 | [diff] [blame] | 180 | |
| 181 | public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { |
Sunny Goyal | 9328a51 | 2017-12-21 12:40:38 -0800 | [diff] [blame] | 182 | return new float[] {1, 0, 0}; |
Sunny Goyal | c99cb17 | 2017-10-19 16:15:09 -0700 | [diff] [blame] | 183 | } |
| 184 | |
Tony | e9054e3 | 2018-03-15 12:48:51 +0000 | [diff] [blame] | 185 | /** |
Tony | 0c95559 | 2018-04-04 10:23:36 -0700 | [diff] [blame] | 186 | * Returns 2 floats designating how to transition overview: |
| 187 | * scale for the current and adjacent pages |
| 188 | * translationY factor where 0 is top aligned and 0.5 is centered vertically |
Tony | e9054e3 | 2018-03-15 12:48:51 +0000 | [diff] [blame] | 189 | */ |
Tony | 0c95559 | 2018-04-04 10:23:36 -0700 | [diff] [blame] | 190 | public float[] getOverviewScaleAndTranslationYFactor(Launcher launcher) { |
Tony Wickham | b2ddf10 | 2018-05-16 12:23:12 -0700 | [diff] [blame] | 191 | return new float[] {1.1f, 0f}; |
Tony | 3bb5e8e | 2018-03-14 12:05:00 +0000 | [diff] [blame] | 192 | } |
| 193 | |
Sunny Goyal | 3e3f44c | 2017-10-23 17:14:52 -0700 | [diff] [blame] | 194 | public void onStateEnabled(Launcher launcher) { |
| 195 | dispatchWindowStateChanged(launcher); |
| 196 | } |
Sunny Goyal | c99cb17 | 2017-10-19 16:15:09 -0700 | [diff] [blame] | 197 | |
| 198 | public void onStateDisabled(Launcher launcher) { } |
Sunny Goyal | be93f26 | 2017-10-20 17:05:27 -0700 | [diff] [blame] | 199 | |
Sunny Goyal | 7185dd6 | 2018-03-14 17:51:49 -0700 | [diff] [blame] | 200 | public int getVisibleElements(Launcher launcher) { |
Tony Wickham | bd6f05e | 2018-03-21 08:16:33 -0700 | [diff] [blame] | 201 | if (launcher.getDeviceProfile().isVerticalBarLayout()) { |
Sunny Goyal | 56e1019 | 2018-05-22 13:22:25 -0700 | [diff] [blame] | 202 | return HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR; |
Tony Wickham | bd6f05e | 2018-03-21 08:16:33 -0700 | [diff] [blame] | 203 | } |
Sunny Goyal | 56e1019 | 2018-05-22 13:22:25 -0700 | [diff] [blame] | 204 | return HOTSEAT_ICONS | HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR; |
Sunny Goyal | 7185dd6 | 2018-03-14 17:51:49 -0700 | [diff] [blame] | 205 | } |
| 206 | |
Sunny Goyal | 228153d | 2018-01-04 15:35:22 -0800 | [diff] [blame] | 207 | /** |
| 208 | * Fraction shift in the vertical translation UI and related properties |
| 209 | * |
| 210 | * @see com.android.launcher3.allapps.AllAppsTransitionController |
| 211 | */ |
| 212 | public float getVerticalProgress(Launcher launcher) { |
| 213 | return 1f; |
| 214 | } |
| 215 | |
Sunny Goyal | 927447e | 2018-05-04 13:19:29 -0700 | [diff] [blame] | 216 | public float getWorkspaceScrimAlpha(Launcher launcher) { |
| 217 | return 0; |
| 218 | } |
| 219 | |
Sunny Goyal | 3e3f44c | 2017-10-23 17:14:52 -0700 | [diff] [blame] | 220 | public String getDescription(Launcher launcher) { |
| 221 | return launcher.getWorkspace().getCurrentPageDescription(); |
| 222 | } |
| 223 | |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 224 | public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { |
| 225 | if (this != NORMAL || !launcher.getDeviceProfile().shouldFadeAdjacentWorkspaceScreens()) { |
| 226 | return DEFAULT_ALPHA_PROVIDER; |
| 227 | } |
Sunny Goyal | 228153d | 2018-01-04 15:35:22 -0800 | [diff] [blame] | 228 | final int centerPage = launcher.getWorkspace().getNextPage(); |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 229 | return new PageAlphaProvider(ACCEL_2) { |
| 230 | @Override |
| 231 | public float getPageAlpha(int pageIndex) { |
| 232 | return pageIndex != centerPage ? 0 : 1f; |
| 233 | } |
| 234 | }; |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 235 | } |
| 236 | |
Sunny Goyal | 49bcf34 | 2018-01-11 13:59:53 -0800 | [diff] [blame] | 237 | public LauncherState getHistoryForState(LauncherState previousState) { |
| 238 | // No history is supported |
| 239 | return NORMAL; |
| 240 | } |
| 241 | |
Sunny Goyal | 75c59ac | 2018-01-15 14:23:11 -0800 | [diff] [blame] | 242 | /** |
| 243 | * Called when the start transition ends and the user settles on this particular state. |
| 244 | */ |
| 245 | public void onStateTransitionEnd(Launcher launcher) { |
Hyunyoung Song | 4bd4725 | 2018-06-05 16:26:32 -0700 | [diff] [blame] | 246 | if (this == NORMAL || this == SPRING_LOADED) { |
Sunny Goyal | 75c59ac | 2018-01-15 14:23:11 -0800 | [diff] [blame] | 247 | UiFactory.resetOverview(launcher); |
Hyunyoung Song | 4bd4725 | 2018-06-05 16:26:32 -0700 | [diff] [blame] | 248 | } |
| 249 | if (this == NORMAL) { |
Sunny Goyal | 623eddd | 2018-03-02 12:24:41 -0800 | [diff] [blame] | 250 | // Clear any rotation locks when going to normal state |
| 251 | launcher.getRotationHelper().setCurrentStateRequest(REQUEST_NONE); |
Sunny Goyal | 75c59ac | 2018-01-15 14:23:11 -0800 | [diff] [blame] | 252 | } |
| 253 | } |
| 254 | |
Sunny Goyal | e39690b | 2018-08-02 13:35:07 -0700 | [diff] [blame^] | 255 | public void onBackPressed(Launcher launcher) { |
| 256 | if (this != NORMAL) { |
| 257 | LauncherStateManager lsm = launcher.getStateManager(); |
| 258 | LauncherState lastState = lsm.getLastState(); |
| 259 | launcher.getUserEventDispatcher().logActionCommand(Action.Command.BACK, |
| 260 | containerType, lastState.containerType); |
| 261 | lsm.goToState(lastState); |
| 262 | } |
| 263 | } |
| 264 | |
Sunny Goyal | 3e3f44c | 2017-10-23 17:14:52 -0700 | [diff] [blame] | 265 | protected static void dispatchWindowStateChanged(Launcher launcher) { |
| 266 | launcher.getWindow().getDecorView().sendAccessibilityEvent(TYPE_WINDOW_STATE_CHANGED); |
| 267 | } |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 268 | |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 269 | public static abstract class PageAlphaProvider { |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 270 | |
Sunny Goyal | 0c72335 | 2017-12-12 12:02:29 -0800 | [diff] [blame] | 271 | public final Interpolator interpolator; |
| 272 | |
| 273 | public PageAlphaProvider(Interpolator interpolator) { |
| 274 | this.interpolator = interpolator; |
| 275 | } |
| 276 | |
| 277 | public abstract float getPageAlpha(int pageIndex); |
Sunny Goyal | bc683e9 | 2017-12-06 10:25:07 -0800 | [diff] [blame] | 278 | } |
Sunny Goyal | 4c7f215 | 2017-10-17 17:17:16 -0700 | [diff] [blame] | 279 | } |