Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f39cc126 authored by Alex Chau's avatar Alex Chau
Browse files

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
parent d9ddf6c1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.launcher3.taskbar;

import static android.view.HapticFeedbackConstants.LONG_PRESS;

import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW;
import static com.android.launcher3.taskbar.Utilities.appendFlag;
@@ -34,7 +35,6 @@ import android.view.WindowInsets;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.quickstep.AnimatedFloat;
@@ -564,7 +564,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba

        updateStateForFlag(FLAG_STASHED_IN_APP_ALL_APPS, false);
        if (applyState) {
            applyState(TaskbarAllAppsSlideInView.DEFAULT_CLOSE_DURATION);
            applyState(ALL_APPS.getTransitionDuration(
                    mControllers.taskbarActivityContext, false /* isToState */));
        }
    }

+11 −5
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@
 */
package com.android.launcher3.taskbar.allapps;

import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_STASHED_IN_APP_ALL_APPS;
import static com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView.DEFAULT_OPEN_DURATION;
import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT;

import com.android.launcher3.AbstractFloatingView;
@@ -81,7 +81,8 @@ final class TaskbarAllAppsViewController {

    private void setUpTaskbarStashing() {
        mTaskbarStashController.updateStateForFlag(FLAG_STASHED_IN_APP_ALL_APPS, true);
        mTaskbarStashController.applyState(DEFAULT_OPEN_DURATION);
        mTaskbarStashController.applyState(
                ALL_APPS.getTransitionDuration(mContext, true /* isToState */));
        mSlideInView.setOnCloseBeginListener(() -> {
            AbstractFloatingView.closeOpenContainer(
                    mContext, AbstractFloatingView.TYPE_ACTION_POPUP);
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public final class RecentsViewStateController extends
        if (toState == OVERVIEW_SPLIT_SELECT) {
            // Animation to "dismiss" selected taskView
            PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation(
                    toState.getTransitionDuration(mLauncher));
                    toState.getTransitionDuration(mLauncher, true /* isToState */));
            // Add properties to shift remaining taskViews to get out of placeholder view
            splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first,
                    toState.getSplitSelectTranslation(mLauncher), LINEAR);
+2 −2
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ public class AllAppsState extends LauncherState {
    }

    @Override
    public int getTransitionDuration(Context context) {
        return 150;
    public int getTransitionDuration(Context context, boolean isToState) {
        return isToState ? 500 : 300;
    }

    @Override
Loading