use of com.android.launcher3.anim.PendingAnimation.EndState in project Neo-Launcher by NeoApplications.
the class LauncherActivityControllerHelper method createActivityControllerInternal.
private void createActivityControllerInternal(Launcher activity, LauncherState fromState, long transitionLength, Consumer<AnimatorPlaybackController> callback) {
LauncherState endState = OVERVIEW;
if (fromState == endState) {
return;
}
AnimatorSet anim = new AnimatorSet();
if (!activity.getDeviceProfile().isVerticalBarLayout() && SysUINavigationMode.getMode(activity) != Mode.NO_BUTTON) {
// Don't animate the shelf when the mode is NO_BUTTON, because we update it atomically.
anim.play(activity.getStateManager().createStateElementAnimation(INDEX_SHELF_ANIM, fromState.getVerticalProgress(activity), endState.getVerticalProgress(activity)));
}
playScaleDownAnim(anim, activity, fromState, endState);
anim.setDuration(transitionLength * 2);
anim.setInterpolator(LINEAR);
AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(anim, transitionLength * 2);
activity.getStateManager().setCurrentUserControlledAnimation(controller);
// Since we are changing the start position of the UI, reapply the state, at the end
controller.setEndAction(() -> {
activity.getStateManager().goToState(controller.getInterpolatedProgress() > 0.5 ? endState : fromState, false);
});
callback.accept(controller);
}
use of com.android.launcher3.anim.PendingAnimation.EndState in project android_packages_apps_Trebuchet by LineageOS.
the class RecentsView method createAllTasksDismissAnimation.
public PendingAnimation createAllTasksDismissAnimation(long duration) {
if (FeatureFlags.IS_STUDIO_BUILD && mPendingAnimation != null) {
throw new IllegalStateException("Another pending animation is still running");
}
PendingAnimation anim = new PendingAnimation(duration);
int count = getTaskViewCount();
for (int i = 0; i < count; i++) {
addDismissedTaskAnimations(getTaskViewAt(i), duration, anim);
}
mPendingAnimation = anim;
mPendingAnimation.addEndListener((endState) -> {
if (endState.isSuccess) {
// Remove all the task views now
ActivityManagerWrapper.getInstance().removeAllRecentTasks();
removeTasksViewsAndClearAllButton();
startHome();
}
mPendingAnimation = null;
});
return anim;
}
Aggregations