Search in sources :

Example 1 with StateHandler

use of com.android.launcher3.LauncherStateManager.StateHandler in project android_packages_apps_Launcher3 by crdroidandroid.

the class StateManager method createAtomicAnimation.

/**
 * Creates an animation representing atomic transitions between the provided states
 */
public AnimatorSet createAtomicAnimation(STATE_TYPE fromState, STATE_TYPE toState, StateAnimationConfig config) {
    PendingAnimation builder = new PendingAnimation(config.duration);
    prepareForAtomicAnimation(fromState, toState, config);
    for (StateHandler handler : mActivity.getStateManager().getStateHandlers()) {
        handler.setStateWithAnimation(toState, config, builder);
    }
    return builder.buildAnim();
}
Also used : PendingAnimation(com.android.launcher3.anim.PendingAnimation)

Example 2 with StateHandler

use of com.android.launcher3.LauncherStateManager.StateHandler in project android_packages_apps_Launcher3 by AOSPA.

the class StateManager method createAtomicAnimation.

/**
 * Creates an animation representing atomic transitions between the provided states
 */
public AnimatorSet createAtomicAnimation(STATE_TYPE fromState, STATE_TYPE toState, StateAnimationConfig config) {
    PendingAnimation builder = new PendingAnimation(config.duration);
    prepareForAtomicAnimation(fromState, toState, config);
    for (StateHandler handler : mActivity.getStateManager().getStateHandlers()) {
        handler.setStateWithAnimation(toState, config, builder);
    }
    return builder.buildAnim();
}
Also used : PendingAnimation(com.android.launcher3.anim.PendingAnimation)

Example 3 with StateHandler

use of com.android.launcher3.LauncherStateManager.StateHandler in project android_packages_apps_Launcher3 by AOSPA.

the class StateManager method createAnimationToNewWorkspaceInternal.

private PendingAnimation createAnimationToNewWorkspaceInternal(final STATE_TYPE state) {
    PendingAnimation builder = new PendingAnimation(mConfig.duration);
    if (!mConfig.hasAnimationFlag(SKIP_ALL_ANIMATIONS)) {
        for (StateHandler handler : getStateHandlers()) {
            handler.setStateWithAnimation(state, mConfig, builder);
        }
    }
    builder.addListener(createStateAnimationListener(state));
    mConfig.setAnimation(builder.buildAnim(), state);
    return builder;
}
Also used : PendingAnimation(com.android.launcher3.anim.PendingAnimation)

Example 4 with StateHandler

use of com.android.launcher3.LauncherStateManager.StateHandler in project android_packages_apps_Trebuchet by LineageOS.

the class StateManager method createAtomicAnimation.

/**
 * Creates an animation representing atomic transitions between the provided states
 */
public AnimatorSet createAtomicAnimation(STATE_TYPE fromState, STATE_TYPE toState, StateAnimationConfig config) {
    PendingAnimation builder = new PendingAnimation(config.duration);
    prepareForAtomicAnimation(fromState, toState, config);
    for (StateHandler handler : mActivity.getStateManager().getStateHandlers()) {
        handler.setStateWithAnimation(toState, config, builder);
    }
    return builder.buildAnim();
}
Also used : PendingAnimation(com.android.launcher3.anim.PendingAnimation)

Example 5 with StateHandler

use of com.android.launcher3.LauncherStateManager.StateHandler in project Neo-Launcher by NeoApplications.

the class LauncherStateManager method createAnimationToNewWorkspaceInternal.

protected AnimatorSet createAnimationToNewWorkspaceInternal(final LauncherState state, AnimatorSetBuilder builder, final Runnable onCompleteRunnable) {
    for (StateHandler handler : getStateHandlers()) {
        handler.setStateWithAnimation(state, builder, mConfig);
    }
    final AnimatorSet animation = builder.build();
    animation.addListener(new AnimationSuccessListener() {

        @Override
        public void onAnimationStart(Animator animation) {
            // Change the internal state only when the transition actually starts
            onStateTransitionStart(state);
        }

        @Override
        public void onAnimationSuccess(Animator animator) {
            // Run any queued runnables
            if (onCompleteRunnable != null) {
                onCompleteRunnable.run();
            }
            onStateTransitionEnd(state);
        }
    });
    mConfig.setAnimation(animation, state);
    return mConfig.mCurrentAnimation;
}
Also used : Animator(android.animation.Animator) AnimatorSet(android.animation.AnimatorSet) AnimationSuccessListener(com.android.launcher3.anim.AnimationSuccessListener)

Aggregations

PendingAnimation (com.android.launcher3.anim.PendingAnimation)12 BackButtonAlphaHandler (com.android.launcher3.statehandlers.BackButtonAlphaHandler)5 RecentsViewStateController (com.android.launcher3.uioverrides.RecentsViewStateController)5 Animator (android.animation.Animator)1 AnimatorSet (android.animation.AnimatorSet)1 AnimationSuccessListener (com.android.launcher3.anim.AnimationSuccessListener)1