Search in sources :

Example 91 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_404Launcher by P-404.

the class NavBarToHomeTouchController method initCurrentAnimation.

private void initCurrentAnimation() {
    long accuracy = (long) (getShiftRange() * 2);
    final PendingAnimation builder = new PendingAnimation(accuracy);
    if (mStartState.overviewUi) {
        RecentsView recentsView = mLauncher.getOverviewPanel();
        AnimatorControllerWithResistance.createRecentsResistanceFromOverviewAnim(mLauncher, builder);
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            builder.addOnFrameCallback(recentsView::redrawLiveTile);
        }
        AbstractFloatingView.closeOpenContainer(mLauncher, AbstractFloatingView.TYPE_TASK_MENU);
    } else if (mStartState == ALL_APPS) {
        AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
        builder.setFloat(allAppsController, ALL_APPS_PROGRESS, -mPullbackDistance / allAppsController.getShiftRange(), PULLBACK_INTERPOLATOR);
        // Slightly fade out all apps content to further distinguish from scrolling.
        StateAnimationConfig config = new StateAnimationConfig();
        config.duration = accuracy;
        config.setInterpolator(StateAnimationConfig.ANIM_ALL_APPS_FADE, Interpolators.mapToProgress(PULLBACK_INTERPOLATOR, 0, 0.5f));
        allAppsController.setAlphas(mEndState, config, builder);
    }
    AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mLauncher);
    if (topView != null) {
        topView.addHintCloseAnim(mPullbackDistance, PULLBACK_INTERPOLATOR, builder);
    }
    mCurrentAnimation = builder.createPlaybackController();
    mCurrentAnimation.getTarget().addListener(newCancelListener(this::clearState));
}
Also used : PendingAnimation(com.android.launcher3.anim.PendingAnimation) StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig) AllAppsTransitionController(com.android.launcher3.allapps.AllAppsTransitionController) RecentsView(com.android.quickstep.views.RecentsView) AbstractFloatingView(com.android.launcher3.AbstractFloatingView)

Example 92 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_404Launcher by P-404.

the class NoButtonQuickSwitchTouchController method setupAnimators.

private void setupAnimators() {
    // Animate the non-overview components (e.g. workspace, shelf) out of the way.
    StateAnimationConfig nonOverviewBuilder = new StateAnimationConfig();
    nonOverviewBuilder.setInterpolator(ANIM_WORKSPACE_FADE, FADE_OUT_INTERPOLATOR);
    nonOverviewBuilder.setInterpolator(ANIM_ALL_APPS_FADE, FADE_OUT_INTERPOLATOR);
    nonOverviewBuilder.setInterpolator(ANIM_WORKSPACE_SCALE, FADE_OUT_INTERPOLATOR);
    nonOverviewBuilder.setInterpolator(ANIM_DEPTH, FADE_OUT_INTERPOLATOR);
    nonOverviewBuilder.setInterpolator(ANIM_VERTICAL_PROGRESS, TRANSLATE_OUT_INTERPOLATOR);
    updateNonOverviewAnim(QUICK_SWITCH, nonOverviewBuilder);
    mNonOverviewAnim.dispatchOnStart();
    if (mRecentsView.getTaskViewCount() == 0) {
        mRecentsView.setOnEmptyMessageUpdatedListener(isEmpty -> {
            if (!isEmpty && mSwipeDetector.isDraggingState()) {
                // We have loaded tasks, update the animators to start at the correct scale etc.
                setupOverviewAnimators();
            }
        });
    }
    setupOverviewAnimators();
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

Example 93 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_404Launcher by P-404.

the class WorkspaceStateTransitionAnimation method setScrim.

public void setScrim(PropertySetter propertySetter, LauncherState state, StateAnimationConfig config) {
    Scrim workspaceDragScrim = mLauncher.getDragLayer().getWorkspaceDragScrim();
    propertySetter.setFloat(workspaceDragScrim, SCRIM_PROGRESS, state.getWorkspaceBackgroundAlpha(mLauncher), LINEAR);
    SysUiScrim sysUiScrim = mLauncher.getRootView().getSysUiScrim();
    propertySetter.setFloat(sysUiScrim, SYSUI_PROGRESS, state.hasFlag(FLAG_HAS_SYS_UI_SCRIM) ? 1 : 0, LINEAR);
    propertySetter.setViewBackgroundColor(mLauncher.getScrimView(), state.getWorkspaceScrimColor(mLauncher), config.getInterpolator(ANIM_SCRIM_FADE, ACCEL_2));
}
Also used : SysUiScrim(com.android.launcher3.graphics.SysUiScrim) Scrim(com.android.launcher3.graphics.Scrim) SysUiScrim(com.android.launcher3.graphics.SysUiScrim)

Example 94 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_404Launcher by P-404.

the class WorkspaceStateTransitionAnimation method applyChildState.

private void applyChildState(LauncherState state, CellLayout cl, int childIndex, PageAlphaProvider pageAlphaProvider, PropertySetter propertySetter, StateAnimationConfig config) {
    float pageAlpha = pageAlphaProvider.getPageAlpha(childIndex);
    float springLoadedProgress = (state instanceof SpringLoadedState) ? 1.0f : 0f;
    propertySetter.setFloat(cl, CellLayout.SPRING_LOADED_PROGRESS, springLoadedProgress, ZOOM_OUT);
    Interpolator fadeInterpolator = config.getInterpolator(ANIM_WORKSPACE_FADE, pageAlphaProvider.interpolator);
    propertySetter.setFloat(cl.getShortcutsAndWidgets(), VIEW_ALPHA, pageAlpha, fadeInterpolator);
}
Also used : SpringLoadedState(com.android.launcher3.states.SpringLoadedState) Interpolator(android.view.animation.Interpolator)

Example 95 with StateAnimationConfig

use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Launcher3 by crdroidandroid.

the class StateManager method createAnimationToNewWorkspace.

public AnimatorPlaybackController createAnimationToNewWorkspace(STATE_TYPE state, long duration, @AnimationFlags int animFlags) {
    StateAnimationConfig config = new StateAnimationConfig();
    config.duration = duration;
    config.animFlags = animFlags;
    return createAnimationToNewWorkspace(state, config);
}
Also used : StateAnimationConfig(com.android.launcher3.states.StateAnimationConfig)

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