use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Launcher3 by crdroidandroid.
the class FallbackRecentsView method onPrepareGestureEndAnimation.
/**
* When the gesture ends and we're going to recents view, we also remove the temporary
* invisible tile added for the home task. This also pushes the remaining tiles back
* to the center.
*/
@Override
public void onPrepareGestureEndAnimation(@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget) {
super.onPrepareGestureEndAnimation(animatorSet, endTarget);
if (mHomeTaskInfo != null && endTarget == RECENTS && animatorSet != null) {
TaskView tv = getTaskView(mHomeTaskInfo.taskId);
if (tv != null) {
PendingAnimation pa = createTaskDismissAnimation(tv, true, false, 150);
pa.addEndListener(e -> setCurrentTask(-1));
AnimatorPlaybackController controller = pa.createPlaybackController();
controller.dispatchOnStart();
animatorSet.play(controller.getAnimationPlayer());
}
}
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherTaskbarUIController method createAnimToLauncher.
/**
* Create Taskbar animation when going from an app to Launcher.
* @param toState If known, the state we will end up in when reaching Launcher.
*/
public Animator createAnimToLauncher(@Nullable LauncherState toState, long duration) {
PendingAnimation anim = new PendingAnimation(duration);
anim.add(mTaskbarAnimationController.createAnimToBackgroundAlpha(0, duration));
if (toState != null) {
mTaskbarStateHandler.setStateWithAnimation(toState, new StateAnimationConfig(), anim);
}
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mIsAnimatingToLauncher = true;
mTaskbarView.setHolesAllowedInLayout(true);
mTaskbarView.updateHotseatItemsVisibility();
}
@Override
public void onAnimationEnd(Animator animation) {
mIsAnimatingToLauncher = false;
setTaskbarViewVisible(false);
}
});
return anim.buildAnim();
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherActivityInterface method prepareRecentsUI.
@Override
public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState, boolean activityVisible, Consumer<AnimatorControllerWithResistance> callback) {
notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
DefaultAnimationFactory factory = new DefaultAnimationFactory(callback) {
@Override
protected void createBackgroundToOverviewAnim(BaseQuickstepLauncher activity, PendingAnimation pa) {
super.createBackgroundToOverviewAnim(activity, pa);
// Animate the blur and wallpaper zoom
float fromDepthRatio = BACKGROUND_APP.getDepth(activity);
float toDepthRatio = OVERVIEW.getDepth(activity);
pa.addFloat(getDepthController(), new ClampedDepthProperty(fromDepthRatio, toDepthRatio), fromDepthRatio, toDepthRatio, LINEAR);
}
};
BaseQuickstepLauncher launcher = factory.initUI();
// Since all apps is not visible, we can safely reset the scroll position.
// This ensures then the next swipe up to all-apps starts from scroll 0.
launcher.getAppsView().reset(false);
return factory;
}
use of com.android.launcher3.util.PendingAnimation 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();
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Launcher3 by crdroidandroid.
the class RecentsView method runDismissAnimation.
private void runDismissAnimation(PendingAnimation pendingAnim) {
AnimatorPlaybackController controller = pendingAnim.createPlaybackController();
controller.dispatchOnStart();
controller.getAnimationPlayer().setInterpolator(FAST_OUT_SLOW_IN);
controller.start();
}
Aggregations