Search in sources :

Example 6 with ToState

use of com.android.launcher3.logger.LauncherAtom.ToState in project android_packages_apps_Launcher3 by crdroidandroid.

the class LauncherActivityInterface method getParallelAnimationToLauncher.

@Override
@Nullable
public Animator getParallelAnimationToLauncher(GestureEndTarget endTarget, long duration) {
    LauncherTaskbarUIController uiController = getTaskbarController();
    Animator superAnimator = super.getParallelAnimationToLauncher(endTarget, duration);
    if (uiController == null) {
        return superAnimator;
    }
    LauncherState toState = stateFromGestureEndTarget(endTarget);
    Animator taskbarAnimator = uiController.createAnimToLauncher(toState, duration);
    if (superAnimator == null) {
        return taskbarAnimator;
    } else {
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(superAnimator, taskbarAnimator);
        return animatorSet;
    }
}
Also used : LauncherState(com.android.launcher3.LauncherState) LauncherTaskbarUIController(com.android.launcher3.taskbar.LauncherTaskbarUIController) Animator(android.animation.Animator) AnimatorSet(android.animation.AnimatorSet) Nullable(androidx.annotation.Nullable)

Example 7 with ToState

use of com.android.launcher3.logger.LauncherAtom.ToState in project android_packages_apps_Launcher3 by crdroidandroid.

the class RecentsViewStateController method setStateWithAnimationInternal.

@Override
void setStateWithAnimationInternal(@NonNull LauncherState toState, @NonNull StateAnimationConfig config, @NonNull PendingAnimation builder) {
    super.setStateWithAnimationInternal(toState, config, builder);
    if (toState.overviewUi) {
        // While animating into recents, update the visible task data as needed
        builder.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
        mRecentsView.updateEmptyMessage();
    } else {
        builder.addListener(AnimatorListeners.forSuccessCallback(mRecentsView::resetTaskVisuals));
    }
    // Create or dismiss split screen select animations
    LauncherState currentState = mLauncher.getStateManager().getState();
    if (isSplitSelectionState(toState) && !isSplitSelectionState(currentState)) {
        builder.add(mRecentsView.createSplitSelectInitAnimation().buildAnim());
    } else if (!isSplitSelectionState(toState) && isSplitSelectionState(currentState)) {
        builder.add(mRecentsView.cancelSplitSelect(true).buildAnim());
    }
    setAlphas(builder, config, toState);
    builder.setFloat(mRecentsView, FULLSCREEN_PROGRESS, toState.getOverviewFullscreenProgress(), LINEAR);
}
Also used : LauncherState(com.android.launcher3.LauncherState)

Example 8 with ToState

use of com.android.launcher3.logger.LauncherAtom.ToState in project android_packages_apps_Launcher3 by crdroidandroid.

the class BaseRecentsViewStateController method setStateWithAnimationInternal.

/**
 * Core logic for animating the recents view UI.
 *
 * @param toState state to animate to
 * @param config current animation config
 * @param setter animator set builder
 */
void setStateWithAnimationInternal(@NonNull final LauncherState toState, @NonNull StateAnimationConfig config, @NonNull PendingAnimation setter) {
    float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
    setter.setFloat(mRecentsView, RECENTS_SCALE_PROPERTY, scaleAndOffset[0], config.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR));
    setter.setFloat(mRecentsView, ADJACENT_PAGE_HORIZONTAL_OFFSET, scaleAndOffset[1], config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR));
    setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f, config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
    PagedOrientationHandler orientationHandler = ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
    FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION, mLauncher.getDeviceProfile());
    setter.setFloat(mRecentsView, taskViewsFloat, toState.getSplitSelectTranslation(mLauncher), LINEAR);
    setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0, config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
    setter.setFloat(mRecentsView, getTaskModalnessProperty(), toState.getOverviewModalness(), config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR));
    setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f, LINEAR);
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) RecentsView(com.android.quickstep.views.RecentsView) FloatProperty(android.util.FloatProperty)

Aggregations

LauncherState (com.android.launcher3.LauncherState)4 PendingAnimation (com.android.launcher3.anim.PendingAnimation)3 Animator (android.animation.Animator)2 StateAnimationConfig (com.android.launcher3.states.StateAnimationConfig)2 RecentsView (com.android.quickstep.views.RecentsView)2 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 AnimatorSet (android.animation.AnimatorSet)1 ValueAnimator (android.animation.ValueAnimator)1 FloatProperty (android.util.FloatProperty)1 VISIBLE (android.view.View.VISIBLE)1 Nullable (androidx.annotation.Nullable)1 CellLayout (com.android.launcher3.CellLayout)1 Hotseat (com.android.launcher3.Hotseat)1 HINT_STATE (com.android.launcher3.LauncherState.HINT_STATE)1 HINT_STATE_TWO_BUTTON (com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON)1 NORMAL (com.android.launcher3.LauncherState.NORMAL)1 OVERVIEW (com.android.launcher3.LauncherState.OVERVIEW)1 Workspace (com.android.launcher3.Workspace)1 WorkspaceStateTransitionAnimation.getSpringScaleAnimator (com.android.launcher3.WorkspaceStateTransitionAnimation.getSpringScaleAnimator)1 AnimatorPlaybackController (com.android.launcher3.anim.AnimatorPlaybackController)1