Loading quickstep/res/values/dimens.xml +0 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,4 @@ <!-- Launcher app transition --> <dimen name="content_trans_y">25dp</dimen> <dimen name="workspace_trans_y">80dp</dimen> <dimen name="shelf_min_value">-2.857dp</dimen> </resources> quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java +26 −27 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.launcher3; import static com.android.launcher3.views.AllAppsScrim.SCRIM_PROGRESS; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS; import static com.android.systemui.shared.recents.utilities.Utilities.getNextFrameNumber; import static com.android.systemui.shared.recents.utilities.Utilities.getSurface; import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously; Loading @@ -40,9 +40,9 @@ import android.view.animation.Interpolator; import android.widget.ImageView; import com.android.launcher3.InsettableFrameLayout.LayoutParams; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.views.AllAppsScrim; import com.android.systemui.shared.system.ActivityCompat; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; Loading @@ -62,14 +62,16 @@ public class LauncherAppTransitionManager { private static final int CLOSING_TRANSITION_DURATION_MS = 350; // Progress = 0: All apps is fully pulled up, Progress = 1: All apps is fully pulled down. private static final float ALL_APPS_PROGRESS_START = 1.3059858f; private static final float ALL_APPS_PROGRESS_SLIDE_END = 0.99581414f; private final DragLayer mDragLayer; private final Launcher mLauncher; private final DeviceProfile mDeviceProfile; private final float mContentTransY; private final float mWorkspaceTransY; // The smallest y-value the shelf will reach on screen, before overshooting back down to 0. private final float mShelfMinValue; private ImageView mFloatingView; private boolean mIsRtl; Loading @@ -84,7 +86,6 @@ public class LauncherAppTransitionManager { Resources res = launcher.getResources(); mContentTransY = res.getDimensionPixelSize(R.dimen.content_trans_y); mWorkspaceTransY = res.getDimensionPixelSize(R.dimen.workspace_trans_y); mShelfMinValue = res.getDimensionPixelSize(R.dimen.shelf_min_value); } /** Loading Loading @@ -477,31 +478,29 @@ public class LauncherAppTransitionManager { workspaceAnimator.setDuration(333); workspaceAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); // Animate the shelf AllAppsScrim allAppsScrim = mLauncher.findViewById(R.id.all_apps_scrim); View hotseat = mLauncher.getHotseat(); final float endY = mShelfMinValue; int startY = hotseat.getMeasuredHeight() + (allAppsScrim.getShadowBitmap().getHeight() / 2); hotseat.setTranslationY(startY); allAppsScrim.setTranslationY(startY); AnimatorSet hotseatSlideIn = new AnimatorSet(); hotseatSlideIn.play(ObjectAnimator.ofFloat(hotseat, View.TRANSLATION_Y, startY, endY)); hotseatSlideIn.play(ObjectAnimator.ofFloat(allAppsScrim, SCRIM_PROGRESS, startY, endY)); hotseatSlideIn.setStartDelay(150); hotseatSlideIn.setDuration(317); hotseatSlideIn.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); AnimatorSet hotseatOvershoot = new AnimatorSet(); hotseatOvershoot.play(ObjectAnimator.ofFloat(hotseat, View.TRANSLATION_Y, endY, 0)); hotseatOvershoot.play(ObjectAnimator.ofFloat(allAppsScrim, SCRIM_PROGRESS, endY, 0)); hotseatOvershoot.setDuration(153); hotseatOvershoot.setInterpolator(Interpolators.OVERSHOOT_0); // Animate the shelf in two parts: slide in, and overeshoot. AllAppsTransitionController allAppsController = mLauncher.getAllAppsController(); // The shelf will start offscreen final float startY = ALL_APPS_PROGRESS_START; // And will end slightly pulled up, so that there is something to overshoot back to 1f. final float slideEnd = ALL_APPS_PROGRESS_SLIDE_END; allAppsController.setProgress(startY); Animator allAppsSlideIn = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS, startY, slideEnd); allAppsSlideIn.setStartDelay(150); allAppsSlideIn.setDuration(317); allAppsSlideIn.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); Animator allAppsOvershoot = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS, slideEnd, 1f); allAppsOvershoot.setDuration(153); allAppsOvershoot.setInterpolator(Interpolators.OVERSHOOT_0); AnimatorSet resumeLauncherAnimation = new AnimatorSet(); resumeLauncherAnimation.play(workspaceAnimator); resumeLauncherAnimation.playSequentially(hotseatSlideIn, hotseatOvershoot); resumeLauncherAnimation.playSequentially(allAppsSlideIn, allAppsOvershoot); return resumeLauncherAnimation; } } Loading src/com/android/launcher3/allapps/AllAppsTransitionController.java +4 −3 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import com.android.launcher3.views.AllAppsScrim; public class AllAppsTransitionController implements SearchUiManager.OnScrollRangeChangeListener, LauncherStateManager.StateHandler { private static final Property<AllAppsTransitionController, Float> PROGRESS = new Property<AllAppsTransitionController, Float>(Float.class, "progress") { public static final Property<AllAppsTransitionController, Float> ALL_APPS_PROGRESS = new Property<AllAppsTransitionController, Float>(Float.class, "allAppsProgress") { @Override public Float get(AllAppsTransitionController controller) { Loading Loading @@ -164,7 +164,8 @@ public class AllAppsTransitionController } Interpolator interpolator = config.userControlled ? LINEAR : FAST_OUT_SLOW_IN; ObjectAnimator anim = ObjectAnimator.ofFloat(this, PROGRESS, mProgress, targetProgress); ObjectAnimator anim = ObjectAnimator.ofFloat(this, ALL_APPS_PROGRESS, mProgress, targetProgress); anim.setDuration(config.duration); anim.setInterpolator(interpolator); anim.addListener(getProgressAnimatorListener()); Loading src/com/android/launcher3/views/AllAppsScrim.java +5 −29 Original line number Diff line number Diff line Loading @@ -61,25 +61,11 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { private final NinePatchDrawHelper mShadowHelper = new NinePatchDrawHelper(); private float mProgress; private int mFillAlpha; private float mDrawHeight; private float mDrawOffsetY; public static final Property<AllAppsScrim, Float> SCRIM_PROGRESS = new Property<AllAppsScrim, Float>(Float.class, "allAppsScrimProgress") { @Override public Float get(AllAppsScrim allAppsScrim) { return allAppsScrim.getProgress(); } @Override public void set(AllAppsScrim allAppsScrim, Float progress) { allAppsScrim.setProgress(progress); } }; public AllAppsScrim(Context context) { this(context, null); } Loading Loading @@ -174,23 +160,17 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { public void setProgress(float translateY, float alpha) { int newAlpha = Math.round(alpha * mAlphaRange + mMinAlpha); if (newAlpha != mFillAlpha) { mFillAlpha = newAlpha; mFillPaint.setAlpha(mFillAlpha); invalidateDrawRect(); } setProgress(translateY); } public void setProgress(float translateY) { // Negative translation means the scrim is moving up. For negative translation, we change // draw offset as it requires redraw (since more area of the scrim needs to be shown). For // position translation, we simply translate the scrim down as it avoids invalidate and // hence could be optimized by the platform. float drawOffsetY = Math.min(translateY, 0); if (drawOffsetY != mDrawOffsetY) { if (newAlpha != mFillAlpha || drawOffsetY != mDrawOffsetY) { invalidateDrawRect(); mFillAlpha = newAlpha; mFillPaint.setAlpha(mFillAlpha); mDrawOffsetY = drawOffsetY; invalidateDrawRect(); } Loading @@ -198,10 +178,6 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { setTranslationY(Math.max(translateY, 0)); } public float getProgress() { return mProgress; } private void invalidateDrawRect() { mDrawRect.top = (int) (getHeight() + mDrawOffsetY - mDrawHeight + mPadding.top - mShadowBlur - 0.5f); Loading Loading
quickstep/res/values/dimens.xml +0 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,4 @@ <!-- Launcher app transition --> <dimen name="content_trans_y">25dp</dimen> <dimen name="workspace_trans_y">80dp</dimen> <dimen name="shelf_min_value">-2.857dp</dimen> </resources>
quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java +26 −27 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.launcher3; import static com.android.launcher3.views.AllAppsScrim.SCRIM_PROGRESS; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS; import static com.android.systemui.shared.recents.utilities.Utilities.getNextFrameNumber; import static com.android.systemui.shared.recents.utilities.Utilities.getSurface; import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously; Loading @@ -40,9 +40,9 @@ import android.view.animation.Interpolator; import android.widget.ImageView; import com.android.launcher3.InsettableFrameLayout.LayoutParams; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.views.AllAppsScrim; import com.android.systemui.shared.system.ActivityCompat; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; Loading @@ -62,14 +62,16 @@ public class LauncherAppTransitionManager { private static final int CLOSING_TRANSITION_DURATION_MS = 350; // Progress = 0: All apps is fully pulled up, Progress = 1: All apps is fully pulled down. private static final float ALL_APPS_PROGRESS_START = 1.3059858f; private static final float ALL_APPS_PROGRESS_SLIDE_END = 0.99581414f; private final DragLayer mDragLayer; private final Launcher mLauncher; private final DeviceProfile mDeviceProfile; private final float mContentTransY; private final float mWorkspaceTransY; // The smallest y-value the shelf will reach on screen, before overshooting back down to 0. private final float mShelfMinValue; private ImageView mFloatingView; private boolean mIsRtl; Loading @@ -84,7 +86,6 @@ public class LauncherAppTransitionManager { Resources res = launcher.getResources(); mContentTransY = res.getDimensionPixelSize(R.dimen.content_trans_y); mWorkspaceTransY = res.getDimensionPixelSize(R.dimen.workspace_trans_y); mShelfMinValue = res.getDimensionPixelSize(R.dimen.shelf_min_value); } /** Loading Loading @@ -477,31 +478,29 @@ public class LauncherAppTransitionManager { workspaceAnimator.setDuration(333); workspaceAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); // Animate the shelf AllAppsScrim allAppsScrim = mLauncher.findViewById(R.id.all_apps_scrim); View hotseat = mLauncher.getHotseat(); final float endY = mShelfMinValue; int startY = hotseat.getMeasuredHeight() + (allAppsScrim.getShadowBitmap().getHeight() / 2); hotseat.setTranslationY(startY); allAppsScrim.setTranslationY(startY); AnimatorSet hotseatSlideIn = new AnimatorSet(); hotseatSlideIn.play(ObjectAnimator.ofFloat(hotseat, View.TRANSLATION_Y, startY, endY)); hotseatSlideIn.play(ObjectAnimator.ofFloat(allAppsScrim, SCRIM_PROGRESS, startY, endY)); hotseatSlideIn.setStartDelay(150); hotseatSlideIn.setDuration(317); hotseatSlideIn.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); AnimatorSet hotseatOvershoot = new AnimatorSet(); hotseatOvershoot.play(ObjectAnimator.ofFloat(hotseat, View.TRANSLATION_Y, endY, 0)); hotseatOvershoot.play(ObjectAnimator.ofFloat(allAppsScrim, SCRIM_PROGRESS, endY, 0)); hotseatOvershoot.setDuration(153); hotseatOvershoot.setInterpolator(Interpolators.OVERSHOOT_0); // Animate the shelf in two parts: slide in, and overeshoot. AllAppsTransitionController allAppsController = mLauncher.getAllAppsController(); // The shelf will start offscreen final float startY = ALL_APPS_PROGRESS_START; // And will end slightly pulled up, so that there is something to overshoot back to 1f. final float slideEnd = ALL_APPS_PROGRESS_SLIDE_END; allAppsController.setProgress(startY); Animator allAppsSlideIn = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS, startY, slideEnd); allAppsSlideIn.setStartDelay(150); allAppsSlideIn.setDuration(317); allAppsSlideIn.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); Animator allAppsOvershoot = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS, slideEnd, 1f); allAppsOvershoot.setDuration(153); allAppsOvershoot.setInterpolator(Interpolators.OVERSHOOT_0); AnimatorSet resumeLauncherAnimation = new AnimatorSet(); resumeLauncherAnimation.play(workspaceAnimator); resumeLauncherAnimation.playSequentially(hotseatSlideIn, hotseatOvershoot); resumeLauncherAnimation.playSequentially(allAppsSlideIn, allAppsOvershoot); return resumeLauncherAnimation; } } Loading
src/com/android/launcher3/allapps/AllAppsTransitionController.java +4 −3 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import com.android.launcher3.views.AllAppsScrim; public class AllAppsTransitionController implements SearchUiManager.OnScrollRangeChangeListener, LauncherStateManager.StateHandler { private static final Property<AllAppsTransitionController, Float> PROGRESS = new Property<AllAppsTransitionController, Float>(Float.class, "progress") { public static final Property<AllAppsTransitionController, Float> ALL_APPS_PROGRESS = new Property<AllAppsTransitionController, Float>(Float.class, "allAppsProgress") { @Override public Float get(AllAppsTransitionController controller) { Loading Loading @@ -164,7 +164,8 @@ public class AllAppsTransitionController } Interpolator interpolator = config.userControlled ? LINEAR : FAST_OUT_SLOW_IN; ObjectAnimator anim = ObjectAnimator.ofFloat(this, PROGRESS, mProgress, targetProgress); ObjectAnimator anim = ObjectAnimator.ofFloat(this, ALL_APPS_PROGRESS, mProgress, targetProgress); anim.setDuration(config.duration); anim.setInterpolator(interpolator); anim.addListener(getProgressAnimatorListener()); Loading
src/com/android/launcher3/views/AllAppsScrim.java +5 −29 Original line number Diff line number Diff line Loading @@ -61,25 +61,11 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { private final NinePatchDrawHelper mShadowHelper = new NinePatchDrawHelper(); private float mProgress; private int mFillAlpha; private float mDrawHeight; private float mDrawOffsetY; public static final Property<AllAppsScrim, Float> SCRIM_PROGRESS = new Property<AllAppsScrim, Float>(Float.class, "allAppsScrimProgress") { @Override public Float get(AllAppsScrim allAppsScrim) { return allAppsScrim.getProgress(); } @Override public void set(AllAppsScrim allAppsScrim, Float progress) { allAppsScrim.setProgress(progress); } }; public AllAppsScrim(Context context) { this(context, null); } Loading Loading @@ -174,23 +160,17 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { public void setProgress(float translateY, float alpha) { int newAlpha = Math.round(alpha * mAlphaRange + mMinAlpha); if (newAlpha != mFillAlpha) { mFillAlpha = newAlpha; mFillPaint.setAlpha(mFillAlpha); invalidateDrawRect(); } setProgress(translateY); } public void setProgress(float translateY) { // Negative translation means the scrim is moving up. For negative translation, we change // draw offset as it requires redraw (since more area of the scrim needs to be shown). For // position translation, we simply translate the scrim down as it avoids invalidate and // hence could be optimized by the platform. float drawOffsetY = Math.min(translateY, 0); if (drawOffsetY != mDrawOffsetY) { if (newAlpha != mFillAlpha || drawOffsetY != mDrawOffsetY) { invalidateDrawRect(); mFillAlpha = newAlpha; mFillPaint.setAlpha(mFillAlpha); mDrawOffsetY = drawOffsetY; invalidateDrawRect(); } Loading @@ -198,10 +178,6 @@ public class AllAppsScrim extends View implements OnChangeListener, Insettable { setTranslationY(Math.max(translateY, 0)); } public float getProgress() { return mProgress; } private void invalidateDrawRect() { mDrawRect.top = (int) (getHeight() + mDrawOffsetY - mDrawHeight + mPadding.top - mShadowBlur - 0.5f); Loading