Merge "Migrate Interpolators from Launcher3 to the public animation library" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
72fbdc7976
@@ -172,6 +172,7 @@ android_library {
|
||||
static_libs: [
|
||||
"Launcher3ResLib",
|
||||
"launcher-testing-shared",
|
||||
"animationlib"
|
||||
],
|
||||
sdk_version: "current",
|
||||
min_sdk_version: min_launcher3_sdk_version,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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<BaseTaskbarContext> 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+22
-22
@@ -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(),
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+6
-6
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+10
-10
@@ -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);
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -1333,11 +1333,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
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) {
|
||||
@@ -2428,11 +2428,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
|
||||
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;
|
||||
@@ -2461,7 +2461,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
// "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;
|
||||
|
||||
@@ -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<STATE_TYPE extends BaseState<STATE_T
|
||||
long animationDuration = animate ? RECENTS_ATTACH_DURATION : 0;
|
||||
Animator fadeAnim = mActivity.getStateManager()
|
||||
.createStateElementAnimation(INDEX_RECENTS_FADE_ANIM, attached ? 1 : 0);
|
||||
fadeAnim.setInterpolator(attached ? INSTANT : ACCEL_2);
|
||||
fadeAnim.setInterpolator(attached ? INSTANT : ACCELERATE_2);
|
||||
fadeAnim.setDuration(animationDuration);
|
||||
animatorSet.play(fadeAnim);
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.content.Intent.EXTRA_COMPONENT_NAME;
|
||||
import static android.content.Intent.EXTRA_USER;
|
||||
|
||||
import static com.android.app.animation.Interpolators.ACCELERATE;
|
||||
import static com.android.launcher3.GestureNavContract.EXTRA_GESTURE_CONTRACT;
|
||||
import static com.android.launcher3.GestureNavContract.EXTRA_ICON_POSITION;
|
||||
import static com.android.launcher3.GestureNavContract.EXTRA_ICON_SURFACE;
|
||||
import static com.android.launcher3.GestureNavContract.EXTRA_ON_FINISH_CALLBACK;
|
||||
import static com.android.launcher3.GestureNavContract.EXTRA_REMOTE_CALLBACK;
|
||||
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
@@ -295,7 +295,7 @@ public class FallbackSwipeHandler extends
|
||||
@Override
|
||||
public AnimatorPlaybackController createActivityAnimationToHome() {
|
||||
PendingAnimation pa = new PendingAnimation(mDuration);
|
||||
pa.setFloat(mRecentsAlpha, AnimatedFloat.VALUE, 0, ACCEL);
|
||||
pa.setFloat(mRecentsAlpha, AnimatedFloat.VALUE, 0, ACCELERATE);
|
||||
return pa.createPlaybackController();
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ public class FallbackSwipeHandler extends
|
||||
@Override
|
||||
public void playAtomicAnimation(float velocity) {
|
||||
ObjectAnimator alphaAnim = mHomeAlpha.animateToValue(mHomeAlpha.value, 1);
|
||||
alphaAnim.setDuration(mDuration).setInterpolator(ACCEL);
|
||||
alphaAnim.setDuration(mDuration).setInterpolator(ACCELERATE);
|
||||
alphaAnim.start();
|
||||
|
||||
if (mRunningOverHome) {
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package com.android.quickstep;
|
||||
|
||||
import static com.android.app.animation.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
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.anim.AnimatorListeners.forEndCallback;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package com.android.quickstep;
|
||||
|
||||
import static com.android.app.animation.Interpolators.EXAGGERATED_EASE;
|
||||
import static com.android.app.animation.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.Utilities.mapBoundToRange;
|
||||
import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
|
||||
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
|
||||
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
|
||||
|
||||
@@ -48,6 +48,7 @@ import android.window.SplashScreen;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
@@ -56,7 +57,6 @@ import com.android.launcher3.LauncherAnimationRunner.AnimationResult;
|
||||
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.compat.AccessibilityManagerCompat;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
@@ -297,7 +297,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
|
||||
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);
|
||||
|
||||
@@ -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;
|
||||
@@ -218,7 +218,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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() {
|
||||
|
||||
+7
-7
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
new SurfaceTransactionApplier(mActivity.getDragLayer());
|
||||
ValueAnimator appAnimator = ValueAnimator.ofFloat(0, 1);
|
||||
appAnimator.setDuration(RECENTS_LAUNCH_DURATION);
|
||||
appAnimator.setInterpolator(ACCEL_DEACCEL);
|
||||
appAnimator.setInterpolator(ACCELERATE_DECELERATE);
|
||||
appAnimator.addUpdateListener(valueAnimator -> {
|
||||
float percent = valueAnimator.getAnimatedFraction();
|
||||
SurfaceTransaction transaction = new SurfaceTransaction();
|
||||
@@ -3132,7 +3132,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
// Use setFloat instead of setViewAlpha as we want to keep the view visible even when it's
|
||||
// alpha is set to 0 so that it can be recycled in the view pool properly
|
||||
anim.setFloat(taskView, VIEW_ALPHA, 0,
|
||||
clampToProgress(isOnGridBottomRow(taskView) ? ACCEL : FINAL_FRAME, 0, 0.5f));
|
||||
clampToProgress(isOnGridBottomRow(taskView) ? ACCELERATE : FINAL_FRAME, 0, 0.5f));
|
||||
FloatProperty<TaskView> secondaryViewTranslate =
|
||||
taskView.getSecondaryDismissTranslationProperty();
|
||||
int secondaryTaskDimension = mOrientationHandler.getSecondaryDimension(taskView);
|
||||
@@ -4285,7 +4285,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
|
||||
private void updatePageOffsets() {
|
||||
float offset = mAdjacentPageHorizontalOffset;
|
||||
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
|
||||
float modalOffset = ACCELERATE_0_75.getInterpolation(mTaskModalness);
|
||||
int count = getChildCount();
|
||||
boolean showAsGrid = showAsGrid();
|
||||
|
||||
@@ -4718,7 +4718,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
|
||||
// Fade out all other views underneath placeholders
|
||||
ObjectAnimator tvFade = ObjectAnimator.ofFloat(this, RecentsView.CONTENT_ALPHA,1, 0);
|
||||
pendingAnimation.add(tvFade, DEACCEL_2, SpringProperty.DEFAULT);
|
||||
pendingAnimation.add(tvFade, DECELERATE_2, SpringProperty.DEFAULT);
|
||||
pendingAnimation.buildAnim().start();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
|
||||
import com.android.launcher3.popup.SystemShortcut;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
@@ -256,7 +256,7 @@ public class TaskMenuView extends AbstractFloatingView {
|
||||
|
||||
final Animator revealAnimator = createOpenCloseOutlineProvider()
|
||||
.createRevealAnimator(this, closing);
|
||||
revealAnimator.setInterpolator(Interpolators.DEACCEL);
|
||||
revealAnimator.setInterpolator(Interpolators.DECELERATE);
|
||||
mOpenCloseAnimator.playTogether(revealAnimator,
|
||||
ObjectAnimator.ofFloat(
|
||||
mTaskContainer.getThumbnailView(), DIM_ALPHA,
|
||||
|
||||
@@ -20,11 +20,11 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID;
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
|
||||
import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE;
|
||||
import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN;
|
||||
import static com.android.app.animation.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
|
||||
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
@@ -71,11 +71,11 @@ import androidx.annotation.IntDef;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.popup.SystemShortcut;
|
||||
@@ -163,7 +163,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
public static final long SCALE_ICON_DURATION = 120;
|
||||
private static final long DIM_ANIM_DURATION = 700;
|
||||
|
||||
private static final Interpolator GRID_INTERPOLATOR = ACCEL_DEACCEL;
|
||||
private static final Interpolator GRID_INTERPOLATOR = ACCELERATE_DECELERATE;
|
||||
|
||||
/**
|
||||
* This technically can be a vanilla {@link TouchDelegate} class, however that class requires
|
||||
|
||||
@@ -35,7 +35,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.dragndrop.DragController;
|
||||
import com.android.launcher3.dragndrop.DragLayer;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
@@ -258,7 +258,7 @@ public abstract class ButtonDropTarget extends TextView
|
||||
|
||||
dragLayer.animateView(d.dragView, to, scale, 0.1f, 0.1f,
|
||||
DRAG_VIEW_DROP_DURATION,
|
||||
Interpolators.DEACCEL_2, onAnimationEndRunnable,
|
||||
Interpolators.DECELERATE_2, onAnimationEndRunnable,
|
||||
DragLayer.ANIMATION_END_DISAPPEAR, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.android.launcher3;
|
||||
|
||||
import static android.animation.ValueAnimator.areAnimatorsEnabled;
|
||||
|
||||
import static com.android.app.animation.Interpolators.DECELERATE_1_5;
|
||||
import static com.android.launcher3.LauncherState.EDIT_MODE;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
|
||||
import static com.android.launcher3.dragndrop.DraggableView.DRAGGABLE_ICON;
|
||||
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
|
||||
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_REORDER_BOUNCE_OFFSET;
|
||||
@@ -60,9 +60,9 @@ import androidx.annotation.IntDef;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.accessibility.DragAndDropAccessibilityDelegate;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.celllayout.CellLayoutLayoutParams;
|
||||
import com.android.launcher3.celllayout.CellPosMapper.CellPos;
|
||||
import com.android.launcher3.celllayout.ReorderAlgorithm;
|
||||
@@ -272,7 +272,7 @@ public class CellLayout extends ViewGroup {
|
||||
mReorderPreviewAnimationMagnitude = (REORDER_PREVIEW_MAGNITUDE * deviceProfile.iconSizePx);
|
||||
|
||||
// Initialize the data structures used for the drag visualization.
|
||||
mEaseOutInterpolator = Interpolators.DEACCEL_2_5; // Quint ease out
|
||||
mEaseOutInterpolator = Interpolators.DECELERATE_QUINT; // Quint ease out
|
||||
mDragCell[0] = mDragCell[1] = -1;
|
||||
mDragCellSpan[0] = mDragCellSpan[1] = -1;
|
||||
for (int i = 0; i < mDragOutlines.length; i++) {
|
||||
@@ -1606,7 +1606,7 @@ public class CellLayout extends ViewGroup {
|
||||
ValueAnimator va = ObjectAnimator.ofFloat(this, ANIMATION_PROGRESS,
|
||||
animationProgress, 0);
|
||||
a = va;
|
||||
a.setInterpolator(DEACCEL_1_5);
|
||||
a.setInterpolator(DECELERATE_1_5);
|
||||
a.setDuration(REORDER_ANIMATION_DURATION);
|
||||
a.start();
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import static com.android.app.animation.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.InvariantDeviceProfile.INDEX_DEFAULT;
|
||||
import static com.android.launcher3.InvariantDeviceProfile.INDEX_LANDSCAPE;
|
||||
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_LANDSCAPE;
|
||||
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_PORTRAIT;
|
||||
import static com.android.launcher3.Utilities.dpiFromPx;
|
||||
import static com.android.launcher3.Utilities.pxFromSp;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH;
|
||||
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
|
||||
import static com.android.launcher3.icons.GraphicsUtils.getShapePath;
|
||||
|
||||
@@ -30,7 +30,7 @@ import android.view.ViewDebug;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.dragndrop.DragController;
|
||||
import com.android.launcher3.dragndrop.DragController.DragListener;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
@@ -42,7 +42,7 @@ public class DropTargetBar extends FrameLayout
|
||||
implements DragListener, Insettable {
|
||||
|
||||
protected static final int DEFAULT_DRAG_FADE_DURATION = 175;
|
||||
protected static final TimeInterpolator DEFAULT_INTERPOLATOR = Interpolators.ACCEL;
|
||||
protected static final TimeInterpolator DEFAULT_INTERPOLATOR = Interpolators.ACCELERATE;
|
||||
|
||||
private final Runnable mFadeAnimationEndRunnable =
|
||||
() -> updateVisibility(DropTargetBar.this);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<LauncherState> {
|
||||
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<LauncherState> {
|
||||
};
|
||||
|
||||
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<LauncherState> {
|
||||
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<LauncherState> {
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<T extends View & PageIndicator> extends PagedView<T>
|
||||
// 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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<Launcher> 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<Launcher> 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) {
|
||||
|
||||
@@ -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<T extends Context & ActivityContext> 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T extends Context & ActivityContext>
|
||||
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<T extends Context & ActivityContext>
|
||||
}
|
||||
|
||||
protected Interpolator getIdleInterpolator() {
|
||||
return Interpolators.ACCEL;
|
||||
return Interpolators.ACCELERATE;
|
||||
}
|
||||
|
||||
protected void onCloseComplete() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user