mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Update pull back animation for tablet AllApps
- This is a follow-up of http://ag/17636490 - Introduced animation property specifically for pullback translation and alpha, which will invoke getRecyclerViewContainer directly on tablet, and invoke aggregate setter of appsView on phones - Delay reset of pullback animation to after dismiss animation to avoid jump in value during state transition animation - Introduced property factory for addictive properties similar to MultiScalePropertyFactory Fix: 220345008 Test: manual on small and large screen Change-Id: I7b5c0019c1d4d36c3c7ca4ec79e38e4eb09c32ca
This commit is contained in:
@@ -21,7 +21,8 @@ import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRES
|
||||
import static com.android.launcher3.LauncherAnimUtils.newCancelListener;
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_PROGRESS;
|
||||
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_ALPHA;
|
||||
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION;
|
||||
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_EDU;
|
||||
@@ -40,11 +41,9 @@ import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.compat.AccessibilityManagerCompat;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.touch.SingleAxisSwipeDetector;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
import com.android.quickstep.TaskUtils;
|
||||
@@ -148,16 +147,10 @@ public class NavBarToHomeTouchController implements TouchController,
|
||||
AbstractFloatingView.closeOpenContainer(mLauncher, AbstractFloatingView.TYPE_TASK_MENU);
|
||||
} else if (mStartState == ALL_APPS) {
|
||||
AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
|
||||
builder.setFloat(allAppsController, ALL_APPS_PULL_BACK_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);
|
||||
builder.setFloat(allAppsController, ALL_APPS_PULL_BACK_TRANSLATION,
|
||||
-mPullbackDistance, PULLBACK_INTERPOLATOR);
|
||||
builder.setFloat(allAppsController, ALL_APPS_PULL_BACK_ALPHA,
|
||||
0.5f, PULLBACK_INTERPOLATOR);
|
||||
}
|
||||
AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mLauncher);
|
||||
if (topView != null) {
|
||||
|
||||
Reference in New Issue
Block a user