mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Tune AllApps dismiss animation
- Avoid overriding interpolator in AllAppsTransitionController.setStateWithAnimation as it's no longer needed and it'll wrongly override interpolator for ANIM_ALL_APPS_FADE - Override ANIM_ALL_APPS_FADE to FINAL_FRAME in QuickstepAtomicAnimationFactory for tap deadzone to dismiss animation, also added EMPHASIZED_ACCELERATE for the dismiss animation - Tuned dismiss animation across form factors to 300ms Fix: 220336617 Test: manual Change-Id: I4b3e827b503dcb1dd39f0bd99d4c1dd5ffdba0f3
This commit is contained in:
@@ -15,13 +15,16 @@
|
||||
*/
|
||||
package com.android.launcher3.taskbar.allapps;
|
||||
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE;
|
||||
import static com.android.systemui.animation.Interpolators.EMPHASIZED_ACCELERATE;
|
||||
|
||||
import android.animation.PropertyValuesHolder;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Insettable;
|
||||
@@ -33,9 +36,6 @@ import java.util.Optional;
|
||||
/** Wrapper for taskbar all apps with slide-in behavior. */
|
||||
public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllAppsContext>
|
||||
implements Insettable, DeviceProfile.OnDeviceProfileChangeListener {
|
||||
static final int DEFAULT_OPEN_DURATION = 500;
|
||||
public static final int DEFAULT_CLOSE_DURATION = 200;
|
||||
|
||||
private TaskbarAllAppsContainerView mAppsView;
|
||||
private OnCloseListener mOnCloseBeginListener;
|
||||
private float mShiftRange;
|
||||
@@ -61,7 +61,8 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp
|
||||
mOpenCloseAnimator.setValues(
|
||||
PropertyValuesHolder.ofFloat(TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED));
|
||||
mOpenCloseAnimator.setInterpolator(AGGRESSIVE_EASE);
|
||||
mOpenCloseAnimator.setDuration(DEFAULT_OPEN_DURATION).start();
|
||||
mOpenCloseAnimator.setDuration(
|
||||
ALL_APPS.getTransitionDuration(mContext, true /* isToState */)).start();
|
||||
} else {
|
||||
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
||||
}
|
||||
@@ -80,7 +81,12 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp
|
||||
@Override
|
||||
protected void handleClose(boolean animate) {
|
||||
Optional.ofNullable(mOnCloseBeginListener).ifPresent(OnCloseListener::onSlideInViewClosed);
|
||||
handleClose(animate, DEFAULT_CLOSE_DURATION);
|
||||
handleClose(animate, ALL_APPS.getTransitionDuration(mContext, false /* isToState */));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Interpolator getIdleInterpolator() {
|
||||
return EMPHASIZED_ACCELERATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user