From 7120373bbc9f7ad6cf2d44966e04d31b2ecd07d3 Mon Sep 17 00:00:00 2001 From: Kateryna Ivanova Date: Wed, 24 May 2023 15:09:00 +0000 Subject: [PATCH] Migrate Interpolators from Launcher3 to the public animation library Test: atest Bug: 271850966 Change-Id: Iba999f2e753764a37d35e508e707df02388432e9 --- Android.bp | 1 + .../launcher3/QuickstepTransitionManager.java | 24 +- .../hybridhotseat/HotseatEduDialog.java | 2 +- .../statehandlers/DepthController.java | 2 +- .../taskbar/KeyboardQuickSwitchView.java | 2 +- .../taskbar/TaskbarBackgroundRenderer.kt | 2 +- .../taskbar/TaskbarDragController.java | 6 +- .../taskbar/TaskbarStashController.java | 8 +- .../taskbar/TaskbarStashViaTouchController.kt | 2 +- .../taskbar/TaskbarTranslationController.java | 2 +- .../taskbar/TaskbarViewController.java | 6 +- .../allapps/TaskbarAllAppsSlideInView.java | 2 +- .../taskbar/bubbles/BubbleBarBackground.kt | 2 +- .../BaseRecentsViewStateController.java | 8 +- .../uioverrides/PredictedAppIcon.java | 6 +- .../uioverrides/QuickstepLauncher.java | 2 +- .../RecentsViewStateController.java | 2 +- .../uioverrides/states/AllAppsState.java | 4 +- .../uioverrides/states/OverviewState.java | 4 +- .../QuickstepAtomicAnimationFactory.java | 44 ++-- .../NavBarToHomeTouchController.java | 4 +- ...ButtonNavbarToOverviewTouchController.java | 4 +- .../NoButtonQuickSwitchTouchController.java | 12 +- .../PortraitStatesTouchController.java | 2 +- .../QuickSwitchTouchController.java | 20 +- .../TaskViewTouchController.java | 2 +- .../android/quickstep/AbsSwipeUpHandler.java | 16 +- .../quickstep/BaseActivityInterface.java | 8 +- .../quickstep/FallbackSwipeHandler.java | 6 +- .../quickstep/LauncherActivityInterface.java | 2 +- .../quickstep/LauncherSwipeHandlerV2.java | 4 +- .../android/quickstep/RecentsActivity.java | 4 +- .../quickstep/SwipeUpAnimationLogic.java | 6 +- .../com/android/quickstep/TaskViewUtils.java | 22 +- .../FallbackRecentsStateController.java | 6 +- .../AssistantInputConsumer.java | 4 +- .../DeviceLockedInputConsumer.java | 4 +- .../ProgressDelegateInputConsumer.java | 2 +- .../quickstep/interaction/AllSetActivity.java | 4 +- .../BackGestureTutorialController.java | 6 +- .../interaction/EdgeBackGesturePanel.java | 2 +- .../OverviewGestureTutorialController.java | 4 +- .../SwipeUpGestureTutorialController.java | 14 +- .../AnimatorControllerWithResistance.java | 6 +- .../quickstep/util/BorderAnimator.java | 2 +- .../util/OverviewToSplitTimings.java | 4 +- .../util/PhoneOverviewToSplitTimings.java | 2 +- .../quickstep/util/SplitAnimationTimings.java | 2 +- .../quickstep/util/SplitToConfirmTimings.java | 2 +- .../util/StaggeredWorkspaceAnim.java | 2 +- .../util/TabletHomeToSplitTimings.java | 2 +- .../util/TabletOverviewToSplitTimings.java | 10 +- .../quickstep/util/TransformParams.java | 5 +- .../quickstep/util/WorkspaceRevealAnim.java | 2 +- .../quickstep/views/AllAppsEduView.java | 6 +- .../quickstep/views/DesktopAppSelectView.java | 2 +- .../quickstep/views/FloatingTaskView.java | 4 +- .../android/quickstep/views/RecentsView.java | 28 +-- .../android/quickstep/views/TaskMenuView.java | 4 +- .../com/android/quickstep/views/TaskView.java | 10 +- .../android/launcher3/ButtonDropTarget.java | 4 +- src/com/android/launcher3/CellLayout.java | 8 +- src/com/android/launcher3/DeviceProfile.java | 2 +- src/com/android/launcher3/DropTargetBar.java | 4 +- src/com/android/launcher3/Launcher.java | 2 +- src/com/android/launcher3/LauncherState.java | 12 +- src/com/android/launcher3/PagedView.java | 2 +- src/com/android/launcher3/Workspace.java | 6 +- .../WorkspaceStateTransitionAnimation.java | 8 +- .../allapps/AllAppsTransitionController.java | 10 +- .../allapps/SearchTransitionController.java | 8 +- .../anim/AnimatorPlaybackController.java | 6 +- .../android/launcher3/anim/Interpolators.java | 237 ------------------ .../anim/SpringAnimationBuilder.java | 2 +- .../launcher3/dragndrop/DragController.java | 2 +- .../launcher3/dragndrop/DragLayer.java | 10 +- .../android/launcher3/dragndrop/DragView.java | 4 +- .../android/launcher3/folder/FolderIcon.java | 4 +- .../graphics/PreloadIconDrawable.java | 4 +- .../notification/NotificationContainer.java | 2 +- .../notification/NotificationMainView.java | 2 +- .../android/launcher3/popup/ArrowPopup.java | 10 +- .../AbstractStateChangeTouchController.java | 2 +- .../touch/AllAppsSwipeController.java | 16 +- .../util/WallpaperOffsetInterpolator.java | 4 +- .../launcher3/views/AbstractSlideInView.java | 8 +- .../android/launcher3/views/ArrowTipView.java | 8 +- .../android/launcher3/views/ClipIconView.java | 2 +- .../launcher3/views/FloatingIconView.java | 2 +- src/com/android/launcher3/views/Snackbar.java | 6 +- .../launcher3/views/WidgetsEduView.java | 2 +- .../widget/AddItemWidgetsBottomSheet.java | 2 +- .../launcher3/widget/BaseWidgetSheet.java | 2 +- .../launcher3/widget/WidgetsBottomSheet.java | 2 +- .../uioverrides/states/AllAppsState.java | 4 +- 95 files changed, 278 insertions(+), 513 deletions(-) delete mode 100644 src/com/android/launcher3/anim/Interpolators.java diff --git a/Android.bp b/Android.bp index a7edf2a9b9..9b696a2640 100644 --- a/Android.bp +++ b/Android.bp @@ -172,6 +172,7 @@ android_library { static_libs: [ "Launcher3ResLib", "launcher-testing-shared", + "animationlib" ], sdk_version: "current", min_sdk_version: min_launcher3_sdk_version, diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 114965fcab..0592510338 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -30,6 +30,12 @@ import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_NONE; import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN; import static android.window.TransitionFilter.CONTAINER_ORDER_TOP; +import static com.android.app.animation.Interpolators.ACCELERATE_1_5; +import static com.android.app.animation.Interpolators.AGGRESSIVE_EASE; +import static com.android.app.animation.Interpolators.DECELERATE_1_5; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.EXAGGERATED_EASE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.BaseActivity.INVISIBLE_ALL; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_APP_TRANSITIONS; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS; @@ -41,12 +47,6 @@ import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.Utilities.mapBoundToRange; -import static com.android.launcher3.anim.Interpolators.ACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_BACK_SWIPE_HOME_ANIMATION; import static com.android.launcher3.config.FeatureFlags.ENABLE_SCRIM_FOR_APP_LAUNCH; import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION; @@ -553,7 +553,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(view, SCALE_PROPERTY, scales) .setDuration(CONTENT_SCALE_DURATION); - scaleAnim.setInterpolator(DEACCEL_1_5); + scaleAnim.setInterpolator(DECELERATE_1_5); launcherAnimator.play(scaleAnim); }); @@ -571,7 +571,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ObjectAnimator scrim = ObjectAnimator.ofArgb(scrimView, VIEW_BACKGROUND_COLOR, colors); scrim.setDuration(CONTENT_SCRIM_DURATION); - scrim.setInterpolator(DEACCEL_1_5); + scrim.setInterpolator(DECELERATE_1_5); launcherAnimator.play(scrim); } @@ -1462,11 +1462,11 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener float startShadowRadius = areAllTargetsTranslucent(appTargets) ? 0 : mMaxShadowRadius; closingAnimator.setDuration(duration); closingAnimator.addUpdateListener(new MultiValueUpdateListener() { - FloatProp mDy = new FloatProp(0, mClosingWindowTransY, 0, duration, DEACCEL_1_7); - FloatProp mScale = new FloatProp(1f, 1f, 0, duration, DEACCEL_1_7); + FloatProp mDy = new FloatProp(0, mClosingWindowTransY, 0, duration, DECELERATE_1_7); + FloatProp mScale = new FloatProp(1f, 1f, 0, duration, DECELERATE_1_7); FloatProp mAlpha = new FloatProp(1f, 0f, 25, 125, LINEAR); FloatProp mShadowRadius = new FloatProp(startShadowRadius, 0, 0, duration, - DEACCEL_1_7); + DECELERATE_1_7); @Override public void onUpdate(float percent, boolean initOnly) { @@ -2032,7 +2032,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (progress >= end) { return 0f; } - return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5); + return Utilities.mapToRange(progress, start, end, 1, 0, ACCELERATE_1_5); } } diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java index 80bdb6f153..bd4792358a 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java @@ -30,6 +30,7 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; @@ -37,7 +38,6 @@ import com.android.launcher3.Insettable; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.uioverrides.PredictedAppIcon; diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 7c62763943..9afcd2ab81 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -16,7 +16,7 @@ package com.android.launcher3.statehandlers; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java index 15f2914ae4..4e9e3019a9 100644 --- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java +++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java @@ -42,10 +42,10 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.util.GroupTask; import java.util.HashMap; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt index fe365f73b2..a9a2ccf025 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt @@ -22,12 +22,12 @@ import android.graphics.Color import android.graphics.Paint import android.graphics.Path import android.graphics.RectF +import com.android.app.animation.Interpolators import com.android.launcher3.DeviceProfile import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapRange import com.android.launcher3.Utilities.mapToRange -import com.android.launcher3.anim.Interpolators import com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound import com.android.launcher3.util.DisplayController diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index 040b8f7bfe..64ba5aa718 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -15,11 +15,11 @@ */ package com.android.launcher3.taskbar; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PREDICTION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -47,6 +47,7 @@ import android.window.SurfaceSyncGroup; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.internal.logging.InstanceId; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; @@ -55,7 +56,6 @@ import com.android.launcher3.DropTarget; import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; import com.android.launcher3.accessibility.DragViewStateAnnouncer; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragDriver; import com.android.launcher3.dragndrop.DragOptions; @@ -642,7 +642,7 @@ public class TaskbarDragController extends DragController im final FloatProp mScale = new FloatProp(1f, toScale, 0, ANIM_DURATION_RETURN_ICON_TO_TASKBAR, FAST_OUT_SLOW_IN); final FloatProp mAlpha = new FloatProp(1f, toAlpha, 0, - ANIM_DURATION_RETURN_ICON_TO_TASKBAR, Interpolators.ACCEL_2); + ANIM_DURATION_RETURN_ICON_TO_TASKBAR, Interpolators.ACCELERATE_2); @Override public void onUpdate(float percent, boolean initOnly) { animListener.updateDragShadow(mDx.value, mDy.value, mScale.value, mAlpha.value); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 00e14adf07..eb4c136ab2 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -18,11 +18,11 @@ package com.android.launcher3.taskbar; import static android.view.HapticFeedbackConstants.LONG_PRESS; import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTROLS; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING_KEY; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt index 1cc667211c..ec93846198 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt @@ -16,9 +16,9 @@ package com.android.launcher3.taskbar import android.view.MotionEvent +import com.android.app.animation.Interpolators.LINEAR import com.android.launcher3.R import com.android.launcher3.Utilities -import com.android.launcher3.anim.Interpolators.LINEAR import com.android.launcher3.testing.shared.ResourceUtils import com.android.launcher3.touch.SingleAxisSwipeDetector import com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_NEGATIVE diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java index 065d1117c8..2b4e67cb0b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java @@ -26,8 +26,8 @@ import android.animation.ValueAnimator; import androidx.annotation.Nullable; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.SpringAnimationBuilder; import com.android.launcher3.util.DisplayController; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 4abd9957b2..528a32892a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.taskbar; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; @@ -22,8 +24,6 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.anim.AnimatedFloat.VALUE; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP; import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; @@ -45,6 +45,7 @@ import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import androidx.core.view.OneShotPreDrawListener; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.R; @@ -53,7 +54,6 @@ import com.android.launcher3.Utilities; import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index cfa1027dcc..84cc00278b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.taskbar.allapps; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.animation.PropertyValuesHolder; import android.content.Context; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt index 7397159f42..8a8e21f9fd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt @@ -21,10 +21,10 @@ import android.graphics.ColorFilter import android.graphics.Paint import android.graphics.drawable.Drawable import android.graphics.drawable.ShapeDrawable +import com.android.app.animation.Interpolators import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapToRange -import com.android.launcher3.anim.Interpolators import com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.wm.shell.common.TriangleShape diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 955440b49a..8c8e267e34 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -16,11 +16,11 @@ package com.android.launcher3.uioverrides; +import static com.android.app.animation.Interpolators.AGGRESSIVE_EASE_IN_OUT; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME; -import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index b059cbdc6c..e61599f8e5 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter; @@ -260,8 +260,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { Keyframe.ofFloat(0.82f, finalTrans - getOutlineOffsetY() / 2f), // Overshoot Keyframe.ofFloat(1f, finalTrans) // Ease back into the final position }; - keyframes[1].setInterpolator(ACCEL_DEACCEL); - keyframes[2].setInterpolator(ACCEL_DEACCEL); + keyframes[1].setInterpolator(ACCELERATE_DECELERATE); + keyframes[2].setInterpolator(ACCELERATE_DECELERATE); mSlotMachineAnim = ObjectAnimator.ofPropertyValuesHolder(this, PropertyValuesHolder.ofKeyframe(SLOT_MACHINE_TRANSLATION_Y, keyframes)); diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index d91e0488cd..d626608d45 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -20,6 +20,7 @@ import static android.os.Trace.TRACE_TAG_APP; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON; import static com.android.launcher3.LauncherSettings.Animation.VIEW_BACKGROUND; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT; @@ -31,7 +32,6 @@ import static com.android.launcher3.LauncherState.NO_OFFSET; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index f16b43df5e..23e922c945 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -15,10 +15,10 @@ */ package com.android.launcher3.uioverrides; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON; import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA; diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java index 2a42175b5b..a4db375046 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import android.content.Context; @@ -91,7 +91,7 @@ public class AllAppsState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { PageAlphaProvider superPageAlphaProvider = super.getWorkspacePageAlphaProvider(launcher); - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return launcher.getDeviceProfile().isTablet diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index 214679acbe..3f0b54e618 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; import android.content.Context; @@ -97,7 +97,7 @@ public class OverviewState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return 0; diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index c7cd39c100..fc5f5671ee 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -17,6 +17,20 @@ package com.android.launcher3.uioverrides.states; import static android.view.View.VISIBLE; +import static com.android.app.animation.Interpolators.ACCELERATE; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.DECELERATE_3; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_0_75; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_2; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON; @@ -25,20 +39,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.QuickstepTransitionManager.TASKBAR_TO_HOME_DURATION; import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator; -import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE; @@ -108,8 +108,8 @@ public class QuickstepAtomicAnimationFactory extends fromState == OVERVIEW_SPLIT_SELECT ? clampToProgress(LINEAR, 0.33f, 1) : LINEAR); - config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL); - config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL); + config.setInterpolator(ANIM_WORKSPACE_SCALE, DECELERATE); + config.setInterpolator(ANIM_WORKSPACE_FADE, ACCELERATE); if (DisplayController.getNavigationMode(mActivity).hasGestures && overview.getTaskViewCount() > 0) { @@ -135,9 +135,9 @@ public class QuickstepAtomicAnimationFactory extends } overview.snapToPage(DEFAULT_PAGE, Math.toIntExact(config.duration)); } else { - config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL); - config.setInterpolator(ANIM_OVERVIEW_SCALE, clampToProgress(ACCEL, 0, 0.9f)); - config.setInterpolator(ANIM_OVERVIEW_FADE, DEACCEL_1_7); + config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCELERATE_DECELERATE); + config.setInterpolator(ANIM_OVERVIEW_SCALE, clampToProgress(ACCELERATE, 0, 0.9f)); + config.setInterpolator(ANIM_OVERVIEW_FADE, DECELERATE_1_7); } Workspace workspace = mActivity.getWorkspace(); @@ -163,8 +163,8 @@ public class QuickstepAtomicAnimationFactory extends || fromState == HINT_STATE_TWO_BUTTON) && toState == OVERVIEW) { if (DisplayController.getNavigationMode(mActivity).hasGestures) { config.setInterpolator(ANIM_WORKSPACE_SCALE, - fromState == NORMAL ? ACCEL : OVERSHOOT_1_2); - config.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL); + fromState == NORMAL ? ACCELERATE : OVERSHOOT_1_2); + config.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCELERATE); // Scrolling in tasks, so show straight away if (overview.getTaskViewCount() > 0) { @@ -192,7 +192,7 @@ public class QuickstepAtomicAnimationFactory extends config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_2); config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, OVERSHOOT_1_2); } else if (fromState == HINT_STATE && toState == NORMAL) { - config.setInterpolator(ANIM_DEPTH, DEACCEL_3); + config.setInterpolator(ANIM_DEPTH, DECELERATE_3); if (mHintToNormalDuration == -1) { ValueAnimator va = getWorkspaceSpringScaleAnimator(mActivity, mActivity.getWorkspace(), diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java index f967e18422..be532206e9 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java @@ -15,6 +15,7 @@ */ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.DECELERATE_3; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL_APPS_EDU; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; @@ -25,7 +26,6 @@ import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_ALPHA; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; @@ -57,7 +57,7 @@ import com.android.quickstep.views.RecentsView; public class NavBarToHomeTouchController implements TouchController, SingleAxisSwipeDetector.Listener { - private static final Interpolator PULLBACK_INTERPOLATOR = DEACCEL_3; + private static final Interpolator PULLBACK_INTERPOLATOR = DECELERATE_3; // The min amount of overview scrim we keep during the transition. private static final float OVERVIEW_TO_HOME_SCRIM_MULTIPLIER = 0.5f; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java index e3b3a793e1..2f5467ea75 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java @@ -16,6 +16,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; import static com.android.launcher3.LauncherState.ALL_APPS; @@ -25,7 +26,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ONE_HANDED_ACTIVE; @@ -280,7 +280,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch mRecentsView.animate() .translationX(0) .translationY(0) - .setInterpolator(ACCEL_DEACCEL) + .setInterpolator(ACCELERATE_DECELERATE) .setDuration(duration) .withEndAction(goToHomeInsteadOfOverview ? null diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index b4224bebae..8bd956c098 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -18,6 +18,10 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_MOVE; +import static com.android.app.animation.Interpolators.ACCELERATE_0_75; +import static com.android.app.animation.Interpolators.DECELERATE_3; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; @@ -28,10 +32,6 @@ import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe; import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_UNKNOWN_SWIPEDOWN; @@ -96,8 +96,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, BothAxesSwipeDetector.Listener { private static final float Y_ANIM_MIN_PROGRESS = 0.25f; - private static final Interpolator FADE_OUT_INTERPOLATOR = DEACCEL_3; - private static final Interpolator TRANSLATE_OUT_INTERPOLATOR = ACCEL_0_75; + private static final Interpolator FADE_OUT_INTERPOLATOR = DECELERATE_3; + private static final Interpolator TRANSLATE_OUT_INTERPOLATOR = ACCELERATE_0_75; private static final Interpolator SCALE_DOWN_INTERPOLATOR = LINEAR; private static final long ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW = 300; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index 8368f9ca03..bb74a3650a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -24,11 +24,11 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import android.view.MotionEvent; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.allapps.AllAppsTransitionController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.touch.AbstractStateChangeTouchController; import com.android.launcher3.touch.AllAppsSwipeController; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java index f941b02065..9a35bb2ae7 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java @@ -15,12 +15,12 @@ */ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; @@ -128,14 +128,14 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll } private void setupInterpolators(StateAnimationConfig stateAnimationConfig) { - stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_FADE, DEACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_2); + stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_FADE, DECELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_ALL_APPS_FADE, DECELERATE_2); if (DisplayController.getNavigationMode(mLauncher) == NavigationMode.NO_BUTTON) { // Overview lives to the left of workspace, so translate down later than over - stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_VERTICAL_PROGRESS, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_SCALE, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, ACCEL_2); + stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_VERTICAL_PROGRESS, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_SCALE, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, ACCELERATE_2); stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); } else { stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, LINEAR); diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index eddc50c64f..3d94857848 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -27,13 +27,13 @@ import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherAnimUtils; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.touch.BaseSwipeDetector; import com.android.launcher3.touch.PagedOrientationHandler; diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 4a4c127231..a546fdf71d 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -21,13 +21,13 @@ import static android.view.Surface.ROTATION_270; import static android.view.Surface.ROTATION_90; import static android.widget.Toast.LENGTH_SHORT; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_STATE_HANDLER; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; import static com.android.launcher3.LauncherPrefs.ALL_APPS_OVERVIEW_THRESHOLD; import static com.android.launcher3.PagedView.INVALID_PAGE; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; 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; @@ -1319,11 +1319,11 @@ public abstract class AbsSwipeUpHandler, Interpolator interpolator; S state = mActivityInterface.stateFromGestureEndTarget(endTarget); if (state.displayOverviewTasksAsGrid(mDp)) { - interpolator = ACCEL_DEACCEL; + interpolator = ACCELERATE_DECELERATE; } else if (endTarget == RECENTS) { interpolator = OVERSHOOT_1_2; } else { - interpolator = DEACCEL; + interpolator = DECELERATE; } if (endTarget.isLauncher) { @@ -2414,11 +2414,11 @@ public abstract class AbsSwipeUpHandler, if (scrollOffset < mQuickSwitchScaleScrollThreshold) { scaleProgress = Utilities.mapToRange(scrollOffset, 0, mQuickSwitchScaleScrollThreshold, - 0, maxScaleProgress, ACCEL_DEACCEL); + 0, maxScaleProgress, ACCELERATE_DECELERATE); } else if (scrollOffset > (maxScrollOffset - mQuickSwitchScaleScrollThreshold)) { scaleProgress = Utilities.mapToRange(scrollOffset, (maxScrollOffset - mQuickSwitchScaleScrollThreshold), maxScrollOffset, - maxScaleProgress, 0, ACCEL_DEACCEL); + maxScaleProgress, 0, ACCELERATE_DECELERATE); } return scaleProgress; @@ -2447,7 +2447,7 @@ public abstract class AbsSwipeUpHandler, // "Catch up" with the displacement at mTaskbarCatchUpThreshold. if (displacement < mTaskbarCatchUpThreshold) { return Utilities.mapToRange(displacement, mTaskbarAppWindowThreshold, - mTaskbarCatchUpThreshold, 0, mTaskbarCatchUpThreshold, ACCEL_DEACCEL); + mTaskbarCatchUpThreshold, 0, mTaskbarCatchUpThreshold, ACCELERATE_DECELERATE); } return displacement; diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 60083c67e7..5a9d80d630 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -15,11 +15,11 @@ */ package com.android.quickstep; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR; import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.AbsSwipeUpHandler.RECENTS_ATTACH_DURATION; import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK; import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS; @@ -553,7 +553,7 @@ public abstract class BaseActivityInterface { if (activityClosing) { Animator adjacentAnimation = mFallbackRecentsView .createAdjacentPageAnimForTaskLaunch(taskView); - adjacentAnimation.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); + adjacentAnimation.setInterpolator(Interpolators.TOUCH_RESPONSE); adjacentAnimation.setDuration(RECENTS_LAUNCH_DURATION); adjacentAnimation.addListener(resetStateListener()); target.play(adjacentAnimation); diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 1b4fdc4a8f..2e93c00962 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -15,8 +15,8 @@ */ package com.android.quickstep; -import static com.android.launcher3.anim.Interpolators.ACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ACCELERATE_1_5; +import static com.android.app.animation.Interpolators.LINEAR; import android.animation.Animator; import android.content.Context; @@ -217,7 +217,7 @@ public abstract class SwipeUpAnimationLogic implements if (progress >= end) { return 0f; } - return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5); + return Utilities.mapToRange(progress, start, end, 1, 0, ACCELERATE_1_5); } } diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 499a2601a9..bfe52ddafc 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -21,6 +21,9 @@ import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_FRONT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.TOUCH_RESPONSE; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; @@ -35,9 +38,6 @@ import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DU import static com.android.launcher3.QuickstepTransitionManager.SPLIT_DIVIDER_ANIM_DURATION; import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; -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.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; import static com.android.quickstep.views.DesktopTaskView.DESKTOP_MODE_SUPPORTED; @@ -61,12 +61,12 @@ import android.window.TransitionInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.BaseActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.statehandlers.DepthController; @@ -237,12 +237,12 @@ public final class TaskViewUtils { for (RemoteTargetHandle targetHandle : remoteTargetHandles) { TaskViewSimulator tvsLocal = targetHandle.getTaskViewSimulator(); out.setFloat(tvsLocal.fullScreenProgress, - AnimatedFloat.VALUE, 1, TOUCH_RESPONSE_INTERPOLATOR); + AnimatedFloat.VALUE, 1, TOUCH_RESPONSE); out.setFloat(tvsLocal.recentsViewScale, AnimatedFloat.VALUE, tvsLocal.getFullScreenScale(), - TOUCH_RESPONSE_INTERPOLATOR); + TOUCH_RESPONSE); out.setFloat(tvsLocal.recentsViewScroll, AnimatedFloat.VALUE, 0, - TOUCH_RESPONSE_INTERPOLATOR); + TOUCH_RESPONSE); out.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { @@ -355,9 +355,9 @@ public final class TaskViewUtils { float fullScreenScale = topMostSimulators[i].getTaskViewSimulator().getFullScreenScale(); out.addFloat(ttv, VIEW_TRANSLATE_Y, translationY, - translationY / fullScreenScale, TOUCH_RESPONSE_INTERPOLATOR); + translationY / fullScreenScale, TOUCH_RESPONSE); out.addFloat(ttv, VIEW_TRANSLATE_X, translationX, - translationX / fullScreenScale, TOUCH_RESPONSE_INTERPOLATOR); + translationX / fullScreenScale, TOUCH_RESPONSE); } Matrix[] k0i = new Matrix[matrixSize]; @@ -405,7 +405,7 @@ public final class TaskViewUtils { if (depthController != null) { out.setFloat(depthController.stateDepth, MULTI_PROPERTY_VALUE, - BACKGROUND_APP.getDepth(baseActivity), TOUCH_RESPONSE_INTERPOLATOR); + BACKGROUND_APP.getDepth(baseActivity), TOUCH_RESPONSE); } } @@ -639,7 +639,7 @@ public final class TaskViewUtils { raController.setWillFinishToHome(false); } launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView); - launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); + launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE); launcherAnim.setDuration(RECENTS_LAUNCH_DURATION); windowAnimEndListener = new AnimatorListenerAdapter() { diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 11b1ab8ec9..8a9e04e488 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -15,9 +15,9 @@ */ package com.android.quickstep.fallback; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X; diff --git a/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java index 162ace4965..a209b3b435 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java @@ -42,9 +42,9 @@ import android.view.HapticFeedbackConstants; import android.view.MotionEvent; import android.view.ViewConfiguration; +import com.android.app.animation.Interpolators; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.BaseActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.InputConsumer; @@ -209,7 +209,7 @@ public class AssistantInputConsumer extends DelegateInputConsumer { SystemUiProxy.INSTANCE.get(mContext).onAssistantProgress(0f); } }); - animator.setInterpolator(Interpolators.DEACCEL_2); + animator.setInterpolator(Interpolators.DECELERATE_2); animator.start(); } mPassedSlop = false; diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java index a5536483df..2a355848b5 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java @@ -39,9 +39,9 @@ import android.view.MotionEvent; import android.view.RemoteAnimationTarget; import android.view.VelocityTracker; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.DisplayController; @@ -203,7 +203,7 @@ public class DeviceLockedInputConsumer implements InputConsumer, // Animate back to fullscreen before finishing ObjectAnimator animator = mProgress.animateToValue(mProgress.value, 0); animator.setDuration(100); - animator.setInterpolator(Interpolators.ACCEL); + animator.setInterpolator(Interpolators.ACCELERATE); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java index ab70272852..5202529942 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.inputconsumers; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.touch.BaseSwipeDetector.calculateDuration; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSITIVE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL; diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index 8274a51ff7..5e1a46e0b9 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -15,10 +15,10 @@ */ package com.android.quickstep.interaction; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.mapBoundToRange; import static com.android.launcher3.Utilities.mapRange; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely; import android.animation.Animator; diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java index 54c441b59e..f1091f26c6 100644 --- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java @@ -23,9 +23,9 @@ import android.annotation.LayoutRes; import android.graphics.PointF; import android.view.View; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult; import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult; import com.android.quickstep.util.LottieAnimationColorUtils; @@ -176,7 +176,7 @@ final class BackGestureTutorialController extends TutorialController { /* upperBound = */ 1f, /* toMin = */ 1f, /* toMax = */ EXITING_APP_MIN_SIZE_PERCENTAGE, - Interpolators.DEACCEL); + Interpolators.DECELERATE); // shrink the exiting app as we progress through the back gesture mExitingAppView.setPivotX(isLeftGesture ? mScreenWidth : 0); @@ -190,7 +190,7 @@ final class BackGestureTutorialController extends TutorialController { /* upperBound = */ 1f, /* toMin = */ 0, /* toMax = */ mExitingAppMargin, - Interpolators.DEACCEL) + Interpolators.DECELERATE) * (isLeftGesture ? -1 : 1)); // round the corners of the exiting app as we progress through the back gesture diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java index 8eb40593c9..a9dcad8db1 100644 --- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java +++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java @@ -40,8 +40,8 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.VibratorWrapper; diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index 667fe4dfad..1c5ad3fe5c 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.interaction; -import static com.android.launcher3.anim.Interpolators.ACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE; import static com.android.launcher3.config.FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL; import android.animation.Animator; @@ -245,7 +245,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont public void animateTaskViewToOverview(boolean animateDelayedSuccessFeedback) { PendingAnimation anim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS); anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCELERATE); if (animateDelayedSuccessFeedback) { anim.addListener(new AnimatorListenerAdapter() { diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java index 0bbf373023..0c14819ec8 100644 --- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.interaction; -import static com.android.launcher3.anim.Interpolators.ACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE; import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static com.android.quickstep.AbsSwipeUpHandler.MAX_SWIPE_DURATION; @@ -160,14 +160,14 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { PendingAnimation anim = new PendingAnimation(300); if (toOverviewFirst) { anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCELERATE); anim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation, boolean isReverse) { PendingAnimation fadeAnim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS); fadeAnim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); if (resetViews) { fadeAnim.addListener(mResetTaskView); } @@ -202,7 +202,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { }); } else { anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); if (resetViews) { anim.addListener(mResetTaskView); } @@ -228,8 +228,8 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { mFakeTaskView.setVisibility(View.VISIBLE); PendingAnimation anim = new PendingAnimation(300); anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); - anim.setViewAlpha(mFakeTaskView, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); + anim.setViewAlpha(mFakeTaskView, 1, ACCELERATE); anim.addListener(mResetTaskView); AnimatorSet animset = anim.buildAnim(); if (animateTaskbar) { @@ -249,7 +249,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { mTaskViewSwipeUpAnimation.handleSwipeUpToHome(finalVelocity); // After home animation finishes, fade out and run onEndRunnable. PendingAnimation fadeAnim = new PendingAnimation(300); - fadeAnim.setViewAlpha(mFakeIconView, 0, ACCEL); + fadeAnim.setViewAlpha(mFakeIconView, 0, ACCELERATE); if (onEndRunnable != null) { fadeAnim.addListener(AnimatorListeners.forSuccessCallback(onEndRunnable)); } diff --git a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java index 6f927d3faf..df9830a93f 100644 --- a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java +++ b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java @@ -15,9 +15,9 @@ */ package com.android.quickstep.util; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherPrefs.ALL_APPS_OVERVIEW_THRESHOLD; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION; @@ -92,7 +92,7 @@ public class AnimatorControllerWithResistance { public final boolean stopScalingAtTop; } - private static final TimeInterpolator RECENTS_SCALE_RESIST_INTERPOLATOR = DEACCEL; + private static final TimeInterpolator RECENTS_SCALE_RESIST_INTERPOLATOR = DECELERATE; private static final TimeInterpolator RECENTS_TRANSLATE_RESIST_INTERPOLATOR = LINEAR; private static final Rect TEMP_RECT = new Rect(); diff --git a/quickstep/src/com/android/quickstep/util/BorderAnimator.java b/quickstep/src/com/android/quickstep/util/BorderAnimator.java index 011d45c8e7..7563187b93 100644 --- a/quickstep/src/com/android/quickstep/util/BorderAnimator.java +++ b/quickstep/src/com/android/quickstep/util/BorderAnimator.java @@ -29,9 +29,9 @@ import android.view.animation.Interpolator; import androidx.annotation.NonNull; import androidx.annotation.Px; +import com.android.app.animation.Interpolators; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorListeners; -import com.android.launcher3.anim.Interpolators; /** * Utility class for drawing a rounded-rect border around a view. diff --git a/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java index e189a66ee4..3027f79f03 100644 --- a/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java @@ -16,8 +16,8 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.INSTANT; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java index f1dde53d12..a38f437664 100644 --- a/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java index 7dc1b32858..93f2255a4d 100644 --- a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java index f5b00cf42b..d1ec2b6f23 100644 --- a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java index cd5edab9d6..9099012214 100644 --- a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +++ b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java @@ -15,11 +15,11 @@ */ package com.android.quickstep.util; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; diff --git a/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java b/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java index bf8612a797..8804049550 100644 --- a/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java index cbf46bfcb8..5463d84b65 100644 --- a/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import android.view.animation.Interpolator; @@ -36,8 +36,8 @@ public class TabletOverviewToSplitTimings public int getGridSlideDuration() { return 500; } public int getDuration() { return TABLET_ENTER_DURATION; } - public Interpolator getStagedRectXInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectYInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectScaleXInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectScaleYInterpolator() { return DEACCEL_2; } + public Interpolator getStagedRectXInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectYInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectScaleXInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectScaleYInterpolator() { return DECELERATE_2; } } diff --git a/quickstep/src/com/android/quickstep/util/TransformParams.java b/quickstep/src/com/android/quickstep/util/TransformParams.java index 0f20e430fc..1cbded63b2 100644 --- a/quickstep/src/com/android/quickstep/util/TransformParams.java +++ b/quickstep/src/com/android/quickstep/util/TransformParams.java @@ -21,8 +21,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import android.util.FloatProperty; import android.view.RemoteAnimationTarget; +import com.android.app.animation.Interpolators; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties; @@ -153,7 +153,8 @@ public class TransformParams { // Fade out Assistant overlay. if (activityType == ACTIVITY_TYPE_ASSISTANT && app.isNotInRecents) { float progress = Utilities.boundToRange(getProgress(), 0, 1); - builder.setAlpha(1 - Interpolators.DEACCEL_2_5.getInterpolation(progress)); + builder.setAlpha(1 - Interpolators.DECELERATE_QUINT + .getInterpolation(progress)); } else { builder.setAlpha(getTargetAlpha()); } diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java index 34fa7f1764..ac8862f27d 100644 --- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java +++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java @@ -32,11 +32,11 @@ import android.animation.ObjectAnimator; import android.util.FloatProperty; import android.view.View; +import com.android.app.animation.Interpolators; import com.android.launcher3.Hotseat; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.states.StateAnimationConfig; diff --git a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java index 716d389a2c..fdc8f1ff14 100644 --- a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java +++ b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java @@ -15,12 +15,12 @@ */ package com.android.quickstep.views; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALL_APPS_EDU_SHOWN; import android.animation.Animator; diff --git a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java b/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java index 53101fbc49..45a26a5f8f 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.views; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.content.Context; import android.util.AttributeSet; diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index 75a8ea2b3b..a5652dc78c 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -1,8 +1,8 @@ package com.android.quickstep.views; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import android.animation.ValueAnimator; import android.content.Context; diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index edd3562c61..3142c9e492 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -21,6 +21,16 @@ import static android.view.Surface.ROTATION_0; import static android.view.View.MeasureSpec.EXACTLY; import static android.view.View.MeasureSpec.makeMeasureSpec; +import static com.android.app.animation.Interpolators.ACCELERATE; +import static com.android.app.animation.Interpolators.ACCELERATE_0_75; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE_2; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_0_75; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; @@ -32,16 +42,6 @@ import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.Utilities.mapToRange; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredTouchSlop; -import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW; import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT; @@ -1180,7 +1180,7 @@ public abstract class RecentsView { float percent = valueAnimator.getAnimatedFraction(); SurfaceTransaction transaction = new SurfaceTransaction(); @@ -3132,7 +3132,7 @@ public abstract class RecentsView secondaryViewTranslate = taskView.getSecondaryDismissTranslationProperty(); int secondaryTaskDimension = mOrientationHandler.getSecondaryDimension(taskView); @@ -4285,7 +4285,7 @@ public abstract class RecentsView updateVisibility(DropTargetBar.this); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5af8e1e2e7..db5a27ac38 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -21,6 +21,7 @@ import static android.app.PendingIntent.FLAG_UPDATE_CURRENT; import static android.content.pm.ActivityInfo.CONFIG_UI_MODE; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER; import static com.android.launcher3.AbstractFloatingView.TYPE_ICON_SURFACE; @@ -43,7 +44,6 @@ import static com.android.launcher3.LauncherState.NO_SCALE; import static com.android.launcher3.LauncherState.SPRING_LOADED; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE; import static com.android.launcher3.config.FeatureFlags.MULTI_SELECT_EDIT_MODE; import static com.android.launcher3.config.FeatureFlags.SHOW_DOT_PAGINATION; diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java index 8b124dc847..05471ada48 100644 --- a/src/com/android/launcher3/LauncherState.java +++ b/src/com/android/launcher3/LauncherState.java @@ -15,8 +15,8 @@ */ 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.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.DECELERATE_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.shared.TestProtocol.ALL_APPS_STATE_ORDINAL; @@ -90,7 +90,7 @@ public abstract class LauncherState implements BaseState { public static final float NO_SCALE = 1; protected static final PageAlphaProvider DEFAULT_ALPHA_PROVIDER = - new PageAlphaProvider(ACCEL_2) { + new PageAlphaProvider(ACCELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return 1; @@ -98,7 +98,7 @@ public abstract class LauncherState implements BaseState { }; protected static final PageTranslationProvider DEFAULT_PAGE_TRANSLATION_PROVIDER = - new PageTranslationProvider(DEACCEL_2) { + new PageTranslationProvider(DECELERATE_2) { @Override public float getPageTranslation(int pageIndex) { return 0; @@ -319,7 +319,7 @@ public abstract class LauncherState implements BaseState { return DEFAULT_ALPHA_PROVIDER; } final int centerPage = launcher.getWorkspace().getNextPage(); - return new PageAlphaProvider(ACCEL_2) { + return new PageAlphaProvider(ACCELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return pageIndex != centerPage ? 0 : 1f; @@ -337,7 +337,7 @@ public abstract class LauncherState implements BaseState { return DEFAULT_PAGE_TRANSLATION_PROVIDER; } final float quarterPageSpacing = launcher.getWorkspace().getPageSpacing() / 4f; - return new PageTranslationProvider(DEACCEL_2) { + return new PageTranslationProvider(DECELERATE_2) { @Override public float getPageTranslation(int pageIndex) { boolean isRtl = launcher.getWorkspace().mIsRtl; diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index af64b3b0ee..4b4a4a5204 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -16,7 +16,7 @@ package com.android.launcher3; -import static com.android.launcher3.anim.Interpolators.SCROLL; +import static com.android.app.animation.Interpolators.SCROLL; import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; import static com.android.launcher3.touch.OverScroll.OVERSCROLL_DAMP_FACTOR; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index dbf08944e0..52755d4e2c 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -67,9 +67,9 @@ import android.widget.Toast; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import com.android.app.animation.Interpolators; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.celllayout.CellPosMapper; @@ -562,9 +562,9 @@ public class Workspace extends PagedView // Change the interpolators such that the fade animation plays before the move animation. // This prevents empty adjacent pages to overlay during animation mLayoutTransition.setInterpolator(LayoutTransition.DISAPPEARING, - Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0, 0.5f)); + Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0, 0.5f)); mLayoutTransition.setInterpolator(LayoutTransition.CHANGE_DISAPPEARING, - Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0.5f, 1)); + Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0.5f, 1)); mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING); mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING); diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 565d7da9e5..c04cdfdb0f 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -18,6 +18,9 @@ package com.android.launcher3; import static androidx.dynamicanimation.animation.DynamicAnimation.MIN_VISIBLE_CHANGE_SCALE; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ZOOM_OUT; import static com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY; import static com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_WORKSPACE_STATE; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; @@ -30,9 +33,6 @@ import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.ZOOM_OUT; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS; import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS; @@ -201,7 +201,7 @@ public class WorkspaceStateTransitionAnimation { propertySetter.setViewBackgroundColor(mLauncher.getScrimView(), state.getWorkspaceScrimColor(mLauncher), - config.getInterpolator(ANIM_SCRIM_FADE, ACCEL_2)); + config.getInterpolator(ANIM_SCRIM_FADE, ACCELERATE_2)); } public void applyChildState(LauncherState state, CellLayout cl, int childIndex) { diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index d4f152aa0a..6ca084a3b7 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -15,14 +15,14 @@ */ package com.android.launcher3.allapps; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT; import static com.android.launcher3.LauncherState.NORMAL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_BOTTOM_SHEET_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; @@ -45,6 +45,7 @@ import android.view.animation.Interpolator; import androidx.annotation.FloatRange; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.Launcher; @@ -53,7 +54,6 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorListeners; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.config.FeatureFlags; @@ -380,7 +380,7 @@ public class AllAppsTransitionController // need to decide depending on the release velocity Interpolator verticalProgressInterpolator = config.getInterpolator(ANIM_VERTICAL_PROGRESS, - config.userControlled ? LINEAR : DEACCEL_1_7); + config.userControlled ? LINEAR : DECELERATE_1_7); Animator anim = createSpringAnimation(mProgress, targetProgress); anim.setInterpolator(verticalProgressInterpolator); anim.addListener(getProgressAnimatorListener()); diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java index b01ea53621..eb1bc0a4be 100644 --- a/src/com/android/launcher3/allapps/SearchTransitionController.java +++ b/src/com/android/launcher3/allapps/SearchTransitionController.java @@ -20,12 +20,12 @@ import static android.view.View.VISIBLE; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import android.animation.ObjectAnimator; import android.animation.TimeInterpolator; @@ -48,7 +48,7 @@ public class SearchTransitionController { private static final String LOG_TAG = "SearchTransitionCtrl"; // Interpolator when the user taps the QSB while already in All Apps. - private static final Interpolator INTERPOLATOR_WITHIN_ALL_APPS = DEACCEL_1_7; + private static final Interpolator INTERPOLATOR_WITHIN_ALL_APPS = DECELERATE_1_7; // Interpolator when the user taps the QSB from home screen, so transition to all apps is // happening simultaneously. private static final Interpolator INTERPOLATOR_TRANSITIONING_TO_ALL_APPS = INSTANT; diff --git a/src/com/android/launcher3/anim/AnimatorPlaybackController.java b/src/com/android/launcher3/anim/AnimatorPlaybackController.java index 1cc0c21745..d11a51f585 100644 --- a/src/com/android/launcher3/anim/AnimatorPlaybackController.java +++ b/src/com/android/launcher3/anim/AnimatorPlaybackController.java @@ -15,10 +15,10 @@ */ package com.android.launcher3.anim; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.Utilities.boundToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs; import android.animation.Animator; diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java deleted file mode 100644 index e88654379a..0000000000 --- a/src/com/android/launcher3/anim/Interpolators.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2017 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.launcher3.anim; - -import android.graphics.Path; -import android.view.animation.AccelerateDecelerateInterpolator; -import android.view.animation.AccelerateInterpolator; -import android.view.animation.DecelerateInterpolator; -import android.view.animation.Interpolator; -import android.view.animation.LinearInterpolator; -import android.view.animation.OvershootInterpolator; -import android.view.animation.PathInterpolator; - -import com.android.launcher3.Utilities; - -/** - * Common interpolators used in Launcher - */ -public class Interpolators { - - public static final Interpolator LINEAR = new LinearInterpolator(); - - public static final Interpolator ACCEL = new AccelerateInterpolator(); - public static final Interpolator ACCEL_0_5 = new AccelerateInterpolator(0.5f); - public static final Interpolator ACCEL_0_75 = new AccelerateInterpolator(0.75f); - public static final Interpolator ACCEL_1_5 = new AccelerateInterpolator(1.5f); - public static final Interpolator ACCEL_2 = new AccelerateInterpolator(2); - - public static final Interpolator DEACCEL = new DecelerateInterpolator(); - public static final Interpolator DEACCEL_1_5 = new DecelerateInterpolator(1.5f); - public static final Interpolator DEACCEL_1_7 = new DecelerateInterpolator(1.7f); - public static final Interpolator DEACCEL_2 = new DecelerateInterpolator(2); - public static final Interpolator DEACCEL_2_5 = new DecelerateInterpolator(2.5f); - public static final Interpolator DEACCEL_3 = new DecelerateInterpolator(3f); - - public static final Interpolator ACCEL_DEACCEL = new AccelerateDecelerateInterpolator(); - - public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f); - - public static final Interpolator AGGRESSIVE_EASE = new PathInterpolator(0.2f, 0f, 0f, 1f); - public static final Interpolator AGGRESSIVE_EASE_IN_OUT = new PathInterpolator(0.6f,0, 0.4f, 1); - - public static final Interpolator DECELERATED_EASE = new PathInterpolator(0, 0, .2f, 1f); - public static final Interpolator ACCELERATED_EASE = new PathInterpolator(0.4f, 0, 1f, 1f); - public static final Interpolator PREDICTIVE_BACK_DECELERATED_EASE = - new PathInterpolator(0, 0, 0, 1f); - - /** - * The default emphasized interpolator. Used for hero / emphasized movement of content. - */ - public static final Interpolator EMPHASIZED = createEmphasizedInterpolator(); - public static final Interpolator EMPHASIZED_ACCELERATE = new PathInterpolator( - 0.3f, 0f, 0.8f, 0.15f); - public static final Interpolator EMPHASIZED_DECELERATE = new PathInterpolator( - 0.05f, 0.7f, 0.1f, 1f); - - public static final Interpolator EXAGGERATED_EASE; - - public static final Interpolator INSTANT = t -> 1; - /** - * All values of t map to 0 until t == 1. This is primarily useful for setting view visibility, - * which should only happen at the very end of the animation (when it's already hidden). - */ - public static final Interpolator FINAL_FRAME = t -> t < 1 ? 0 : 1; - - static { - Path exaggeratedEase = new Path(); - exaggeratedEase.moveTo(0, 0); - exaggeratedEase.cubicTo(0.05f, 0f, 0.133333f, 0.08f, 0.166666f, 0.4f); - exaggeratedEase.cubicTo(0.225f, 0.94f, 0.5f, 1f, 1f, 1f); - EXAGGERATED_EASE = new PathInterpolator(exaggeratedEase); - } - - public static final Interpolator OVERSHOOT_0_75 = new OvershootInterpolator(0.75f); - public static final Interpolator OVERSHOOT_1_2 = new OvershootInterpolator(1.2f); - public static final Interpolator OVERSHOOT_1_7 = new OvershootInterpolator(1.7f); - - public static final Interpolator TOUCH_RESPONSE_INTERPOLATOR = - new PathInterpolator(0.3f, 0f, 0.1f, 1f); - public static final Interpolator TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL = - v -> ACCEL_DEACCEL.getInterpolation(TOUCH_RESPONSE_INTERPOLATOR.getInterpolation(v)); - - /** - * Inversion of ZOOM_OUT, compounded with an ease-out. - */ - public static final Interpolator ZOOM_IN = new Interpolator() { - @Override - public float getInterpolation(float v) { - return DEACCEL_3.getInterpolation(1 - ZOOM_OUT.getInterpolation(1 - v)); - } - }; - - public static final Interpolator ZOOM_OUT = new Interpolator() { - - private static final float FOCAL_LENGTH = 0.35f; - - @Override - public float getInterpolation(float v) { - return zInterpolate(v); - } - - /** - * This interpolator emulates the rate at which the perceived scale of an object changes - * as its distance from a camera increases. When this interpolator is applied to a scale - * animation on a view, it evokes the sense that the object is shrinking due to moving away - * from the camera. - */ - private float zInterpolate(float input) { - return (1.0f - FOCAL_LENGTH / (FOCAL_LENGTH + input)) / - (1.0f - FOCAL_LENGTH / (FOCAL_LENGTH + 1.0f)); - } - }; - - public static final Interpolator SCROLL = new Interpolator() { - @Override - public float getInterpolation(float t) { - t -= 1.0f; - return t*t*t*t*t + 1; - } - }; - - public static final Interpolator SCROLL_CUBIC = new Interpolator() { - @Override - public float getInterpolation(float t) { - t -= 1.0f; - return t*t*t + 1; - } - }; - - private static final float FAST_FLING_PX_MS = 10; - - public static Interpolator scrollInterpolatorForVelocity(float velocity) { - return Math.abs(velocity) > FAST_FLING_PX_MS ? SCROLL : SCROLL_CUBIC; - } - - /** - * Create an OvershootInterpolator with tension directly related to the velocity (in px/ms). - * @param velocity The start velocity of the animation we want to overshoot. - */ - public static Interpolator overshootInterpolatorForVelocity(float velocity) { - return new OvershootInterpolator(Math.min(Math.abs(velocity), 3f)); - } - - /** - * Returns a function that runs the given interpolator such that the entire progress is set - * between the given bounds. That is, we set the interpolation to 0 until lowerBound and reach - * 1 by upperBound. - */ - public static Interpolator clampToProgress(Interpolator interpolator, float lowerBound, - float upperBound) { - if (upperBound < lowerBound) { - throw new IllegalArgumentException( - String.format("upperBound (%f) must be greater than lowerBound (%f)", - upperBound, lowerBound)); - } - return t -> clampToProgress(interpolator, t, lowerBound, upperBound); - } - - /** - * Returns the progress value's progress between the lower and upper bounds. That is, the - * progress will be 0f from 0f to lowerBound, and reach 1f by upperBound. - * - * Between lowerBound and upperBound, the progress value will be interpolated using the provided - * interpolator. - */ - public static float clampToProgress( - Interpolator interpolator, float progress, float lowerBound, float upperBound) { - if (upperBound < lowerBound) { - throw new IllegalArgumentException( - String.format("upperBound (%f) must be greater than lowerBound (%f)", - upperBound, lowerBound)); - } - - if (progress == lowerBound && progress == upperBound) { - return progress == 0f ? 0 : 1; - } - if (progress < lowerBound) { - return 0; - } - if (progress > upperBound) { - return 1; - } - return interpolator.getInterpolation((progress - lowerBound) / (upperBound - lowerBound)); - } - - /** - * Returns the progress value's progress between the lower and upper bounds. That is, the - * progress will be 0f from 0f to lowerBound, and reach 1f by upperBound. - */ - public static float clampToProgress(float progress, float lowerBound, float upperBound) { - return clampToProgress(Interpolators.LINEAR, progress, lowerBound, upperBound); - } - - /** - * Runs the given interpolator such that the interpolated value is mapped to the given range. - * This is useful, for example, if we only use this interpolator for part of the animation, - * such as to take over a user-controlled animation when they let go. - */ - public static Interpolator mapToProgress(Interpolator interpolator, float lowerBound, - float upperBound) { - return t -> Utilities.mapRange(interpolator.getInterpolation(t), lowerBound, upperBound); - } - - /** - * Returns the reverse of the provided interpolator, following the formula: g(x) = 1 - f(1 - x). - * In practice, this means that if f is an interpolator used to model a value animating between - * m and n, g is the interpolator to use to obtain the specular behavior when animating from n - * to m. - */ - public static Interpolator reverse(Interpolator interpolator) { - return t -> 1 - interpolator.getInterpolation(1 - t); - } - - // Create the default emphasized interpolator - private static PathInterpolator createEmphasizedInterpolator() { - Path path = new Path(); - // Doing the same as fast_out_extra_slow_in - path.moveTo(0f, 0f); - path.cubicTo(0.05f, 0f, 0.133333f, 0.06f, 0.166666f, 0.4f); - path.cubicTo(0.208333f, 0.82f, 0.25f, 1f, 1f, 1f); - return new PathInterpolator(path); - } -} diff --git a/src/com/android/launcher3/anim/SpringAnimationBuilder.java b/src/com/android/launcher3/anim/SpringAnimationBuilder.java index 40fa0cfd02..bc7b7f00d2 100644 --- a/src/com/android/launcher3/anim/SpringAnimationBuilder.java +++ b/src/com/android/launcher3/anim/SpringAnimationBuilder.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.anim; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.animation.Animator; import android.animation.ValueAnimator; diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 98672685e9..0d51d4826a 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -28,9 +28,9 @@ import android.view.View; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.DragSource; import com.android.launcher3.DropTarget; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.logging.InstanceId; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 366870b4c2..f18f900593 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -19,11 +19,11 @@ package com.android.launcher3.dragndrop; import static android.animation.ObjectAnimator.ofFloat; +import static com.android.app.animation.Interpolators.DECELERATE_1_5; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.Utilities.mapRange; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import android.animation.Animator; @@ -42,6 +42,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DropTargetBar; import com.android.launcher3.Launcher; @@ -49,7 +50,6 @@ import com.android.launcher3.R; import com.android.launcher3.ShortcutAndWidgetContainer; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.SpringProperty; import com.android.launcher3.celllayout.CellLayoutLayoutParams; @@ -340,14 +340,14 @@ public class DragLayer extends BaseDragLayer implements LauncherOverla if (duration < 0) { duration = res.getInteger(R.integer.config_dropAnimMaxDuration); if (dist < maxDist) { - duration *= DEACCEL_1_5.getInterpolation(dist / maxDist); + duration *= DECELERATE_1_5.getInterpolation(dist / maxDist); } duration = Math.max(duration, res.getInteger(R.integer.config_dropAnimMinDuration)); } // Fall back to cubic ease out interpolator for the animation if none is specified TimeInterpolator interpolator = - motionInterpolator == null ? DEACCEL_1_5 : motionInterpolator; + motionInterpolator == null ? DECELERATE_1_5 : motionInterpolator; // Animate the view PendingAnimation anim = new PendingAnimation(duration); @@ -475,7 +475,7 @@ public class DragLayer extends BaseDragLayer implements LauncherOverla @Override public void onOverlayScrollChanged(float progress) { - float alpha = 1 - Interpolators.DEACCEL_3.getInterpolation(progress); + float alpha = 1 - Interpolators.DECELERATE_3.getInterpolation(progress); float transX = getMeasuredWidth() * progress; if (mIsRtl) { diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 0d0717e4f6..c26d673f8c 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -55,9 +55,9 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.icons.FastBitmapDrawable; import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.model.data.ItemInfo; @@ -371,7 +371,7 @@ public abstract class DragView extends Fram AnimatorSet anim = new AnimatorSet(); anim.play(ObjectAnimator.ofFloat(newContent, VIEW_ALPHA, 0, 1)); anim.play(ObjectAnimator.ofFloat(mContent, VIEW_ALPHA, 0)); - anim.setDuration(duration).setInterpolator(Interpolators.DEACCEL_1_5); + anim.setDuration(duration).setInterpolator(Interpolators.DECELERATE_1_5); anim.start(); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index be643b31e2..d78bfbafb7 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -42,6 +42,7 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.Alarm; import com.android.launcher3.BubbleTextView; import com.android.launcher3.CellLayout; @@ -56,7 +57,6 @@ import com.android.launcher3.Reorderable; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; import com.android.launcher3.allapps.ActivityAllAppsContainerView; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.dot.FolderDotInfo; import com.android.launcher3.dragndrop.BaseItemDragListener; @@ -406,7 +406,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel final int finalIndex = index; dragLayer.animateView(animateView, to, finalAlpha, finalScale, finalScale, DROP_IN_ANIMATION_DURATION, - Interpolators.DEACCEL_2, + Interpolators.DECELERATE_2, () -> { mPreviewItemManager.hidePreviewItem(finalIndex, false); mFolder.showItem(item); diff --git a/src/com/android/launcher3/graphics/PreloadIconDrawable.java b/src/com/android/launcher3/graphics/PreloadIconDrawable.java index d366c4ae0d..c5c74ac429 100644 --- a/src/com/android/launcher3/graphics/PreloadIconDrawable.java +++ b/src/com/android/launcher3/graphics/PreloadIconDrawable.java @@ -17,8 +17,8 @@ package com.android.launcher3.graphics; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V3; diff --git a/src/com/android/launcher3/notification/NotificationContainer.java b/src/com/android/launcher3/notification/NotificationContainer.java index 9eb05cd40f..7cc9ad38bc 100644 --- a/src/com/android/launcher3/notification/NotificationContainer.java +++ b/src/com/android/launcher3/notification/NotificationContainer.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.notification; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.touch.SingleAxisSwipeDetector.HORIZONTAL; import android.animation.Animator; diff --git a/src/com/android/launcher3/notification/NotificationMainView.java b/src/com/android/launcher3/notification/NotificationMainView.java index 16a40576b8..ecd018b26d 100644 --- a/src/com/android/launcher3/notification/NotificationMainView.java +++ b/src/com/android/launcher3/notification/NotificationMainView.java @@ -16,8 +16,8 @@ package com.android.launcher3.notification; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DISMISSED; import android.animation.AnimatorSet; diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index 72f99cb4df..08be026ba8 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -18,11 +18,11 @@ package com.android.launcher3.popup; import static androidx.core.content.ContextCompat.getColorStateList; -import static com.android.launcher3.anim.Interpolators.ACCELERATED_EASE; -import static com.android.launcher3.anim.Interpolators.DECELERATED_EASE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ACCELERATED_EASE; +import static com.android.app.animation.Interpolators.DECELERATED_EASE; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_MATERIAL_U_POPUP; import android.animation.Animator; diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index c499e35ddd..8bc1c3718c 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -15,6 +15,7 @@ */ package com.android.launcher3.touch; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; @@ -22,7 +23,6 @@ import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; diff --git a/src/com/android/launcher3/touch/AllAppsSwipeController.java b/src/com/android/launcher3/touch/AllAppsSwipeController.java index d028f24b0a..b672bde45d 100644 --- a/src/com/android/launcher3/touch/AllAppsSwipeController.java +++ b/src/com/android/launcher3/touch/AllAppsSwipeController.java @@ -15,15 +15,15 @@ */ package com.android.launcher3.touch; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_BOTTOM_SHEET_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; @@ -40,11 +40,11 @@ import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; import android.view.MotionEvent; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.states.StateAnimationConfig; /** diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java index 4ac6bc475c..b97b8894c7 100644 --- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java +++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java @@ -15,9 +15,9 @@ import android.view.animation.Interpolator; import androidx.annotation.AnyThread; +import com.android.app.animation.Interpolators; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; /** * Utility class to handle wallpaper scrolling along with workspace. @@ -237,7 +237,7 @@ public class WallpaperOffsetInterpolator { public OffsetHandler(Context context) { super(UI_HELPER_EXECUTOR.getLooper()); - mInterpolator = Interpolators.DEACCEL_1_5; + mInterpolator = Interpolators.DECELERATE_1_5; mWM = WallpaperManager.getInstance(context); } diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index ec7ec0b6c0..91eb10970b 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -17,11 +17,11 @@ package com.android.launcher3.views; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.allapps.AllAppsTransitionController.REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.util.ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE; import android.animation.Animator; @@ -47,10 +47,10 @@ import androidx.annotation.Nullable; import androidx.annotation.Px; import androidx.annotation.RequiresApi; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.touch.BaseSwipeDetector; import com.android.launcher3.touch.SingleAxisSwipeDetector; @@ -310,7 +310,7 @@ public abstract class AbstractSlideInView TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED)); mOpenCloseAnimator.setDuration( BaseSwipeDetector.calculateDuration(velocity, mTranslationShift)) - .setInterpolator(Interpolators.DEACCEL); + .setInterpolator(Interpolators.DECELERATE); mOpenCloseAnimator.start(); } } @@ -357,7 +357,7 @@ public abstract class AbstractSlideInView } protected Interpolator getIdleInterpolator() { - return Interpolators.ACCEL; + return Interpolators.ACCELERATE; } protected void onCloseComplete() { diff --git a/src/com/android/launcher3/views/ArrowTipView.java b/src/com/android/launcher3/views/ArrowTipView.java index 73c5ad457b..d905aaaadb 100644 --- a/src/com/android/launcher3/views/ArrowTipView.java +++ b/src/com/android/launcher3/views/ArrowTipView.java @@ -35,11 +35,11 @@ import androidx.annotation.Nullable; import androidx.annotation.Px; import androidx.core.content.ContextCompat; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.graphics.TriangleShape; @@ -95,7 +95,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(0) .setDuration(HIDE_DURATION_MS) - .setInterpolator(Interpolators.ACCEL) + .setInterpolator(Interpolators.ACCELERATE) .withEndAction(() -> mActivity.getDragLayer().removeView(this)) .start(); } else { @@ -191,7 +191,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(SHOW_DELAY_MS) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.DEACCEL) + .setInterpolator(Interpolators.DECELERATE) .start(); return this; } @@ -339,7 +339,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(SHOW_DELAY_MS) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.DEACCEL) + .setInterpolator(Interpolators.DECELERATE) .start(); return this; } diff --git a/src/com/android/launcher3/views/ClipIconView.java b/src/com/android/launcher3/views/ClipIconView.java index 694deadb63..87e496e4c2 100644 --- a/src/com/android/launcher3/views/ClipIconView.java +++ b/src/com/android/launcher3/views/ClipIconView.java @@ -15,9 +15,9 @@ */ package com.android.launcher3.views; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.boundToRange; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static java.lang.Math.max; diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 4d0e2aff2d..3b052210a4 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -17,10 +17,10 @@ package com.android.launcher3.views; import static android.view.Gravity.LEFT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.getBadge; import static com.android.launcher3.Utilities.getFullDrawable; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; import static com.android.launcher3.views.IconLabelDotView.setIconAndDotVisible; diff --git a/src/com/android/launcher3/views/Snackbar.java b/src/com/android/launcher3/views/Snackbar.java index 8d5838e592..2d81db8600 100644 --- a/src/com/android/launcher3/views/Snackbar.java +++ b/src/com/android/launcher3/views/Snackbar.java @@ -30,10 +30,10 @@ import android.widget.TextView; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.dragndrop.DragLayer; @@ -159,7 +159,7 @@ public class Snackbar extends AbstractFloatingView { .scaleX(1) .scaleY(1) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.ACCEL_DEACCEL) + .setInterpolator(Interpolators.ACCELERATE_DECELERATE) .start(); int timeout = AccessibilityManagerCompat.getRecommendedTimeoutMillis(activity, TIMEOUT_DURATION_MS, FLAG_CONTENT_TEXT | FLAG_CONTENT_CONTROLS); @@ -174,7 +174,7 @@ public class Snackbar extends AbstractFloatingView { .withLayer() .setStartDelay(0) .setDuration(HIDE_DURATION_MS) - .setInterpolator(Interpolators.ACCEL) + .setInterpolator(Interpolators.ACCELERATE) .withEndAction(this::onClosed) .start(); } else { diff --git a/src/com/android/launcher3/views/WidgetsEduView.java b/src/com/android/launcher3/views/WidgetsEduView.java index c2947c7310..918078178c 100644 --- a/src/com/android/launcher3/views/WidgetsEduView.java +++ b/src/com/android/launcher3/views/WidgetsEduView.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.views; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.content.Context; diff --git a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java index 9442734646..473abf1b1b 100644 --- a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java +++ b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java @@ -16,8 +16,8 @@ package com.android.launcher3.widget; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.Utilities.ATLEAST_R; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.annotation.SuppressLint; diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java index 049131ef10..dcc86a15e9 100644 --- a/src/com/android/launcher3/widget/BaseWidgetSheet.java +++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.widget; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.config.FeatureFlags.LARGE_SCREEN_WIDGET_PICKER; import android.content.Context; diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java index 846dafdf30..93f7cb3afe 100644 --- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java +++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java @@ -16,8 +16,8 @@ package com.android.launcher3.widget; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_BOTTOM_WIDGETS_TRAY; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.content.Context; 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 772a995324..b62dbd1d95 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import android.content.Context; @@ -80,7 +80,7 @@ public class AllAppsState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { PageAlphaProvider superPageAlphaProvider = super.getWorkspacePageAlphaProvider(launcher); - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE) { @Override public float getPageAlpha(int pageIndex) { return launcher.getDeviceProfile().isTablet