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);
}
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));
}
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;
}
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();
}
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);
}
Aggregations