Loading quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +4 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } } if (DisplayController.isTransientTaskbar(mActivity)) { fullLengthAnimatorSet.play(mControllers.taskbarViewController .createRevealAnimToIsStashed(isStashed)); } fullLengthAnimatorSet.play(mControllers.stashedHandleViewController .createRevealAnimToIsStashed(isStashed)); // Return the stashed handle to its default scale in case it was changed as part of the Loading quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +41 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_NEGATIVE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.graphics.Rect; import android.util.FloatProperty; Loading @@ -49,6 +51,8 @@ import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.icons.ThemedIconDrawable; Loading Loading @@ -95,6 +99,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar private float mTaskbarIconTranslationYForSwipe; private final int mTaskbarBottomMargin; private final int mStashedHandleHeight; private final AnimatedFloat mThemeIconsBackground = new AnimatedFloat( this::updateIconsBackground); Loading Loading @@ -127,6 +132,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar mTaskbarBottomMargin = DisplayController.isTransientTaskbar(activity) ? activity.getResources().getDimensionPixelSize(R.dimen.transient_taskbar_margin) : 0; mStashedHandleHeight = activity.getResources() .getDimensionPixelSize(R.dimen.taskbar_stashed_handle_height); if (DisplayController.isTransientTaskbar(mActivity)) { mSwipeDownDetector = new SingleAxisSwipeDetector(activity, Loading Loading @@ -280,6 +287,40 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar )); } private ValueAnimator createRevealAnimForView(View view, boolean isStashed) { Rect viewBounds = new Rect(0, 0, view.getWidth(), view.getHeight()); int centerY = viewBounds.centerY(); int halfHandleHeight = mStashedHandleHeight / 2; Rect stashedRect = new Rect(viewBounds.left, centerY - halfHandleHeight, viewBounds.right, centerY + halfHandleHeight); float radius = 0; float stashedRadius = viewBounds.width() / 2f; return new RoundedRectRevealOutlineProvider(radius, stashedRadius, viewBounds, stashedRect) .createRevealAnimator(view, !isStashed, 0); } /** * Creates and returns a {@link RevealOutlineAnimation} Animator that updates the icon shape * and size. * @param isStashed When true, the icon crops vertically to the size of the stashed handle. * When false, the reverse happens. */ public AnimatorSet createRevealAnimToIsStashed(boolean isStashed) { AnimatorSet as = new AnimatorSet(); for (int i = mTaskbarView.getChildCount() - 1; i >= 0; i--) { View child = mTaskbarView.getChildAt(i); if (child instanceof BubbleTextView) { as.play(createRevealAnimForView(child, isStashed)); } } return as; } /** * Sets the taskbar icon alignment relative to Launcher hotseat icons * @param alignmentRatio [0, 1] Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +4 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } } if (DisplayController.isTransientTaskbar(mActivity)) { fullLengthAnimatorSet.play(mControllers.taskbarViewController .createRevealAnimToIsStashed(isStashed)); } fullLengthAnimatorSet.play(mControllers.stashedHandleViewController .createRevealAnimToIsStashed(isStashed)); // Return the stashed handle to its default scale in case it was changed as part of the Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +41 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_NEGATIVE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.graphics.Rect; import android.util.FloatProperty; Loading @@ -49,6 +51,8 @@ import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.icons.ThemedIconDrawable; Loading Loading @@ -95,6 +99,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar private float mTaskbarIconTranslationYForSwipe; private final int mTaskbarBottomMargin; private final int mStashedHandleHeight; private final AnimatedFloat mThemeIconsBackground = new AnimatedFloat( this::updateIconsBackground); Loading Loading @@ -127,6 +132,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar mTaskbarBottomMargin = DisplayController.isTransientTaskbar(activity) ? activity.getResources().getDimensionPixelSize(R.dimen.transient_taskbar_margin) : 0; mStashedHandleHeight = activity.getResources() .getDimensionPixelSize(R.dimen.taskbar_stashed_handle_height); if (DisplayController.isTransientTaskbar(mActivity)) { mSwipeDownDetector = new SingleAxisSwipeDetector(activity, Loading Loading @@ -280,6 +287,40 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar )); } private ValueAnimator createRevealAnimForView(View view, boolean isStashed) { Rect viewBounds = new Rect(0, 0, view.getWidth(), view.getHeight()); int centerY = viewBounds.centerY(); int halfHandleHeight = mStashedHandleHeight / 2; Rect stashedRect = new Rect(viewBounds.left, centerY - halfHandleHeight, viewBounds.right, centerY + halfHandleHeight); float radius = 0; float stashedRadius = viewBounds.width() / 2f; return new RoundedRectRevealOutlineProvider(radius, stashedRadius, viewBounds, stashedRect) .createRevealAnimator(view, !isStashed, 0); } /** * Creates and returns a {@link RevealOutlineAnimation} Animator that updates the icon shape * and size. * @param isStashed When true, the icon crops vertically to the size of the stashed handle. * When false, the reverse happens. */ public AnimatorSet createRevealAnimToIsStashed(boolean isStashed) { AnimatorSet as = new AnimatorSet(); for (int i = mTaskbarView.getChildCount() - 1; i >= 0; i--) { View child = mTaskbarView.getChildAt(i); if (child instanceof BubbleTextView) { as.play(createRevealAnimForView(child, isStashed)); } } return as; } /** * Sets the taskbar icon alignment relative to Launcher hotseat icons * @param alignmentRatio [0, 1] Loading