Search in sources :

Example 11 with AnimatorSetBuilder

use of com.android.launcher3.anim.AnimatorSetBuilder in project Neo-Launcher by NeoApplications.

the class StaggeredWorkspaceAnim method prepareToAnimate.

/**
 * Setup workspace with 0 duration to prepare for our staggered animation.
 */
private void prepareToAnimate(Launcher launcher) {
    LauncherStateManager stateManager = launcher.getStateManager();
    AnimatorSetBuilder builder = new AnimatorSetBuilder();
    // setRecentsAttachedToAppWindow() will animate recents out.
    builder.addFlag(AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW);
    stateManager.createAtomicAnimation(BACKGROUND_APP, NORMAL, builder, ANIM_ALL, 0);
    builder.build().start();
    // Stop scrolling so that it doesn't interfere with the translation offscreen.
    launcher.<RecentsView>getOverviewPanel().getScroller().forceFinished(true);
}
Also used : AnimatorSetBuilder(com.android.launcher3.anim.AnimatorSetBuilder) RecentsView(com.android.quickstep.views.RecentsView) LauncherStateManager(com.android.launcher3.LauncherStateManager)

Example 12 with AnimatorSetBuilder

use of com.android.launcher3.anim.AnimatorSetBuilder in project Neo-Launcher by NeoApplications.

the class LauncherStateManager method goToStateAnimated.

private void goToStateAnimated(LauncherState state, LauncherState fromState, Runnable onCompleteRunnable) {
    // Since state NORMAL can be reached from multiple states, just assume that the
    // transition plays in reverse and use the same duration as previous state.
    mConfig.duration = state == NORMAL ? fromState.transitionDuration : state.transitionDuration;
    AnimatorSetBuilder builder = new AnimatorSetBuilder();
    prepareForAtomicAnimation(fromState, state, builder);
    AnimatorSet animation = createAnimationToNewWorkspaceInternal(state, builder, onCompleteRunnable);
    mUiHandler.post(new StartAnimRunnable(animation));
}
Also used : AnimatorSetBuilder(com.android.launcher3.anim.AnimatorSetBuilder) AnimatorSet(android.animation.AnimatorSet)

Example 13 with AnimatorSetBuilder

use of com.android.launcher3.anim.AnimatorSetBuilder 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)

Example 14 with AnimatorSetBuilder

use of com.android.launcher3.anim.AnimatorSetBuilder in project Neo-Launcher by NeoApplications.

the class AllAppsTransitionController method setState.

/**
 * Sets the vertical transition progress to {@param state} and updates all the dependent UI
 * accordingly.
 */
@Override
public void setState(LauncherState state) {
    setProgress(state.getVerticalProgress(mLauncher));
    setAlphas(state, null, new AnimatorSetBuilder());
    onProgressAnimationEnd();
}
Also used : AnimatorSetBuilder(com.android.launcher3.anim.AnimatorSetBuilder)

Example 15 with AnimatorSetBuilder

use of com.android.launcher3.anim.AnimatorSetBuilder in project Neo-Launcher by NeoApplications.

the class AllAppsTransitionController method setAlphas.

public void setAlphas(int visibleElements, AnimationConfig config, AnimatorSetBuilder builder) {
    PropertySetter setter = config == null ? NO_ANIM_PROPERTY_SETTER : config.getPropertySetter(builder);
    boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0;
    boolean hasAllAppsContent = (visibleElements & ALL_APPS_CONTENT) != 0;
    Interpolator allAppsFade = builder.getInterpolator(ANIM_ALL_APPS_FADE, LINEAR);
    Interpolator headerFade = builder.getInterpolator(ANIM_ALL_APPS_HEADER_FADE, allAppsFade);
    setter.setViewAlpha(mAppsView.getContentView(), hasAllAppsContent ? 1 : 0, allAppsFade);
    setter.setViewAlpha(mAppsView.getScrollBar(), hasAllAppsContent ? 1 : 0, allAppsFade);
    mAppsView.getFloatingHeaderView().setContentVisibility(hasHeaderExtra, hasAllAppsContent, setter, headerFade, allAppsFade);
    mAppsView.getSearchUiManager().setContentVisibility(visibleElements, setter, allAppsFade);
    setter.setInt(mScrimView, ScrimView.DRAG_HANDLE_ALPHA, (visibleElements & VERTICAL_SWIPE_INDICATOR) != 0 ? 255 : 0, allAppsFade);
}
Also used : PropertySetter(com.android.launcher3.anim.PropertySetter) Interpolator(android.view.animation.Interpolator)

Aggregations

AnimatorSetBuilder (com.android.launcher3.anim.AnimatorSetBuilder)16 Animator (android.animation.Animator)7 AnimatorSet (android.animation.AnimatorSet)4 Interpolator (android.view.animation.Interpolator)4 PropertySetter (com.android.launcher3.anim.PropertySetter)4 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)3 ObjectAnimator (android.animation.ObjectAnimator)3 ValueAnimator (android.animation.ValueAnimator)3 AnimationConfig (com.android.launcher3.LauncherStateManager.AnimationConfig)3 RecentsView (com.android.quickstep.views.RecentsView)3 LauncherState (com.android.launcher3.LauncherState)2 ScaleAndTranslation (com.android.launcher3.LauncherState.ScaleAndTranslation)2 AllAppsTransitionController (com.android.launcher3.allapps.AllAppsTransitionController)2 SpringObjectAnimator (com.android.launcher3.anim.SpringObjectAnimator)2 AbstractFloatingView (com.android.launcher3.AbstractFloatingView)1 PageAlphaProvider (com.android.launcher3.LauncherState.PageAlphaProvider)1 LauncherStateManager (com.android.launcher3.LauncherStateManager)1 AnimationSuccessListener (com.android.launcher3.anim.AnimationSuccessListener)1 DragLayer (com.android.launcher3.dragndrop.DragLayer)1 OverviewScrim (com.android.launcher3.graphics.OverviewScrim)1