Search in sources :

Example 41 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.

the class PortraitStatesTouchController method getNormalToOverviewAnimation.

private StateAnimationConfig getNormalToOverviewAnimation() {
    mAllAppsInterpolatorWrapper.baseInterpolator = LINEAR;
    StateAnimationConfig builder = new StateAnimationConfig();
    builder.setInterpolator(ANIM_VERTICAL_PROGRESS, mAllAppsInterpolatorWrapper);
    return builder;
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

Example 42 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.

the class PortraitStatesTouchController method getAllAppsToOverviewAnimation.

private StateAnimationConfig getAllAppsToOverviewAnimation() {
    StateAnimationConfig builder = new StateAnimationConfig();
    builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL, 1 - ALL_APPS_CONTENT_FADE_THRESHOLD, 1));
    builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(ACCEL, 0f, 1 - RECENTS_FADE_THRESHOLD));
    return builder;
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

Example 43 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.

the class PortraitStatesTouchController method getOverviewToAllAppsAnimation.

private static StateAnimationConfig getOverviewToAllAppsAnimation() {
    StateAnimationConfig builder = new StateAnimationConfig();
    builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD));
    builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(DEACCEL, RECENTS_FADE_THRESHOLD, 1));
    return builder;
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

Example 44 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.

the class PortraitStatesTouchController method getNormalToAllAppsAnimation.

private StateAnimationConfig getNormalToAllAppsAnimation() {
    StateAnimationConfig builder = new StateAnimationConfig();
    builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD));
    return builder;
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

Example 45 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.

the class PortraitStatesTouchController method initCurrentAnimation.

@Override
protected float initCurrentAnimation(@AnimationFlags int animFlags) {
    float range = getShiftRange();
    long maxAccuracy = (long) (2 * range);
    float startVerticalShift = mFromState.getVerticalProgress(mLauncher) * range;
    float endVerticalShift = mToState.getVerticalProgress(mLauncher) * range;
    float totalShift = endVerticalShift - startVerticalShift;
    final StateAnimationConfig config = totalShift == 0 ? new StateAnimationConfig() : getConfigForStates(mFromState, mToState);
    config.animFlags = updateAnimComponentsOnReinit(animFlags);
    config.duration = maxAccuracy;
    cancelPendingAnim();
    if (mFromState == OVERVIEW && mToState == NORMAL && mOverviewPortraitStateTouchHelper.shouldSwipeDownReturnToApp()) {
        // Reset the state manager, when changing the interaction mode
        mLauncher.getStateManager().goToState(OVERVIEW, false);
        mPendingAnimation = mOverviewPortraitStateTouchHelper.createSwipeDownToTaskAppAnimation(maxAccuracy, Interpolators.LINEAR);
        Runnable onCancelRunnable = () -> {
            cancelPendingAnim();
            clearState();
        };
        mCurrentAnimation = mPendingAnimation.createPlaybackController().setOnCancelRunnable(onCancelRunnable);
        mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
        RecentsView recentsView = mLauncher.getOverviewPanel();
        totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
    } else {
        mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace(mToState, config).setOnCancelRunnable(this::clearState);
    }
    if (totalShift == 0) {
        totalShift = Math.signum(mFromState.ordinal - mToState.ordinal) * OverviewState.getDefaultSwipeHeight(mLauncher);
    }
    return 1 / totalShift;
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig) RecentsView(com.android.quickstep.views.RecentsView)

Aggregations

StateAnimationConfig (com.android.launcher3.states.StateAnimationConfig)108 PendingAnimation (com.android.launcher3.anim.PendingAnimation)26 LauncherState (com.android.launcher3.LauncherState)25 RecentsView (com.android.quickstep.views.RecentsView)24 Animator (android.animation.Animator)16 ValueAnimator (android.animation.ValueAnimator)13 Interpolator (android.view.animation.Interpolator)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)9 AnimatorSet (android.animation.AnimatorSet)8 AllAppsTransitionController (com.android.launcher3.allapps.AllAppsTransitionController)8 AnimationSuccessListener (com.android.launcher3.anim.AnimationSuccessListener)7 AbstractFloatingView (com.android.launcher3.AbstractFloatingView)6 BaseQuickstepLauncher (com.android.launcher3.BaseQuickstepLauncher)6 CellLayout (com.android.launcher3.CellLayout)6 Hotseat (com.android.launcher3.Hotseat)6 Workspace (com.android.launcher3.Workspace)6 DepthController (com.android.launcher3.statehandlers.DepthController)6 VISIBLE (android.view.View.VISIBLE)5 HINT_STATE (com.android.launcher3.LauncherState.HINT_STATE)5 HINT_STATE_TWO_BUTTON (com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON)5