use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method getNormalToOverviewAnimation.
private StateAnimationConfig getNormalToOverviewAnimation() {
mAllAppsInterpolatorWrapper.baseInterpolator = LINEAR;
StateAnimationConfig builder = new StateAnimationConfig();
builder.setInterpolator(ANIM_VERTICAL_PROGRESS, mAllAppsInterpolatorWrapper);
return builder;
}
use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method getAllAppsToOverviewAnimation.
private StateAnimationConfig getAllAppsToOverviewAnimation() {
StateAnimationConfig builder = new StateAnimationConfig();
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL, 1 - ALL_APPS_CONTENT_FADE_THRESHOLD, 1));
builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(ACCEL, 0f, 1 - RECENTS_FADE_THRESHOLD));
return builder;
}
use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method getOverviewToAllAppsAnimation.
private static StateAnimationConfig getOverviewToAllAppsAnimation() {
StateAnimationConfig builder = new StateAnimationConfig();
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD));
builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(DEACCEL, RECENTS_FADE_THRESHOLD, 1));
return builder;
}
use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method getNormalToAllAppsAnimation.
private StateAnimationConfig getNormalToAllAppsAnimation() {
StateAnimationConfig builder = new StateAnimationConfig();
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD));
return builder;
}
use of com.android.launcher3.states.StateAnimationConfig in project android_packages_apps_Trebuchet by LineageOS.
the class PortraitStatesTouchController method initCurrentAnimation.
@Override
protected float initCurrentAnimation(@AnimationFlags int animFlags) {
float range = getShiftRange();
long maxAccuracy = (long) (2 * range);
float startVerticalShift = mFromState.getVerticalProgress(mLauncher) * range;
float endVerticalShift = mToState.getVerticalProgress(mLauncher) * range;
float totalShift = endVerticalShift - startVerticalShift;
final StateAnimationConfig config = totalShift == 0 ? new StateAnimationConfig() : getConfigForStates(mFromState, mToState);
config.animFlags = updateAnimComponentsOnReinit(animFlags);
config.duration = maxAccuracy;
cancelPendingAnim();
if (mFromState == OVERVIEW && mToState == NORMAL && mOverviewPortraitStateTouchHelper.shouldSwipeDownReturnToApp()) {
// Reset the state manager, when changing the interaction mode
mLauncher.getStateManager().goToState(OVERVIEW, false);
mPendingAnimation = mOverviewPortraitStateTouchHelper.createSwipeDownToTaskAppAnimation(maxAccuracy, Interpolators.LINEAR);
Runnable onCancelRunnable = () -> {
cancelPendingAnim();
clearState();
};
mCurrentAnimation = mPendingAnimation.createPlaybackController().setOnCancelRunnable(onCancelRunnable);
mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
RecentsView recentsView = mLauncher.getOverviewPanel();
totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
} else {
mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace(mToState, config).setOnCancelRunnable(this::clearState);
}
if (totalShift == 0) {
totalShift = Math.signum(mFromState.ordinal - mToState.ordinal) * OverviewState.getDefaultSwipeHeight(mLauncher);
}
return 1 / totalShift;
}
Aggregations