use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Trebuchet by LineageOS.
the class StaggeredWorkspaceAnim method addDepthAnimationForState.
private void addDepthAnimationForState(Launcher launcher, LauncherState state, long duration) {
if (!(launcher instanceof BaseQuickstepLauncher)) {
return;
}
PendingAnimation builder = new PendingAnimation(duration);
DepthController depthController = ((BaseQuickstepLauncher) launcher).getDepthController();
depthController.setStateWithAnimation(state, new StateAnimationConfig(), builder);
mAnimators.play(builder.buildAnim());
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Trebuchet by LineageOS.
the class SwipeUpAnimationLogic method initTransitionEndpoints.
protected void initTransitionEndpoints(DeviceProfile dp) {
mDp = dp;
mTaskViewSimulator.setDp(dp);
mTransitionDragLength = mGestureState.getActivityInterface().getSwipeUpDestinationAndLength(dp, mContext, TEMP_RECT, mTaskViewSimulator.getOrientationState().getOrientationHandler());
if (mDeviceState.isFullyGesturalNavMode()) {
// We can drag all the way to the top of the screen.
mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength;
} else {
mDragLengthFactor = 1 + AnimatorControllerWithResistance.TWO_BUTTON_EXTRA_DRAG_FACTOR;
}
PendingAnimation pa = new PendingAnimation(mTransitionDragLength * 2);
mTaskViewSimulator.addAppToOverviewAnim(pa, LINEAR);
AnimatorPlaybackController normalController = pa.createPlaybackController();
mWindowTransitionController = AnimatorControllerWithResistance.createForRecents(normalController, mContext, mTaskViewSimulator.getOrientationState(), mDp, mTaskViewSimulator.recentsViewScale, AnimatedFloat.VALUE, mTaskViewSimulator.recentsViewSecondaryTranslation, AnimatedFloat.VALUE);
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Trebuchet by LineageOS.
the class FallbackRecentsView method onGestureAnimationEnd.
/**
* When the gesture ends and recents view become interactive, 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 onGestureAnimationEnd() {
super.onGestureAnimationEnd();
if (mHomeTaskInfo != null) {
TaskView tv = getTaskView(mHomeTaskInfo.taskId);
if (tv != null) {
PendingAnimation pa = createTaskDismissAnimation(tv, true, false, 150);
pa.addEndListener(e -> setCurrentTask(-1));
runDismissAnimation(pa);
}
}
}
use of com.android.launcher3.util.PendingAnimation 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();
}
use of com.android.launcher3.util.PendingAnimation in project android_packages_apps_Trebuchet by LineageOS.
the class NavBarToHomeTouchController method initCurrentAnimation.
private void initCurrentAnimation() {
long accuracy = (long) (getShiftRange() * 2);
final PendingAnimation builder = new PendingAnimation(accuracy);
if (mStartState.overviewUi) {
RecentsView recentsView = mLauncher.getOverviewPanel();
AnimatorControllerWithResistance.createRecentsResistanceFromOverviewAnim(mLauncher, builder);
builder.setFloat(mLauncher.getDragLayer().getOverviewScrim(), OverviewScrim.SCRIM_MULTIPLIER, OVERVIEW_TO_HOME_SCRIM_MULTIPLIER, PULLBACK_INTERPOLATOR);
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
builder.addOnFrameCallback(() -> recentsView.redrawLiveTile(false));
}
} else if (mStartState == ALL_APPS) {
AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
builder.setFloat(allAppsController, ALL_APPS_PROGRESS, -mPullbackDistance / allAppsController.getShiftRange(), PULLBACK_INTERPOLATOR);
// Slightly fade out all apps content to further distinguish from scrolling.
StateAnimationConfig config = new StateAnimationConfig();
config.duration = accuracy;
config.setInterpolator(StateAnimationConfig.ANIM_ALL_APPS_FADE, Interpolators.mapToProgress(PULLBACK_INTERPOLATOR, 0, 0.5f));
allAppsController.setAlphas(mEndState, config, builder);
}
AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mLauncher);
if (topView != null) {
topView.addHintCloseAnim(mPullbackDistance, PULLBACK_INTERPOLATOR, builder);
}
mCurrentAnimation = builder.createPlaybackController().setOnCancelRunnable(this::clearState);
}
Aggregations