From b0195376d4cb849f705fa5ef7f4e537540743fe6 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 3 Apr 2023 10:06:16 -0700 Subject: [PATCH] Fix badged icons / icons with notification dot being cropped. For icons, we use radius = 0 during the reveal animation so that the entire view will be visible. Fixes: 276625136 Test: - have work profile icon or badged shortcut in taskbar/hotseat - swipe up to close - also check swipe back to close - ensure entire icon is visible at the end of the animation so that there is a clean handoff - run same test with icons that have notification dot Flag: ENABLE_TRANSIENT_TASKBAR true Change-Id: I3fef1eede5cac189dab1bf1be4ebd048720727c7 --- .../launcher3/taskbar/TaskbarViewController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 4ab093f220..6eb409e35d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -286,7 +286,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar } private ValueAnimator createRevealAnimForView(View view, boolean isStashed, float newWidth, - boolean shouldStartAlign) { + boolean isQsb) { Rect viewBounds = new Rect(0, 0, view.getWidth(), view.getHeight()); int centerY = viewBounds.centerY(); int halfHandleHeight = mStashedHandleHeight / 2; @@ -295,7 +295,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar final int left; final int right; - if (shouldStartAlign) { + // QSB will crop from the 'start' whereas all other icons will crop from the center. + if (isQsb) { if (mIsRtl) { right = viewBounds.right; left = (int) (right - newWidth); @@ -311,7 +312,10 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar } Rect stashedRect = new Rect(left, top, right, bottom); - float radius = viewBounds.height() / 2f; + // QSB radius can be > 0 since it does not have any UI elements outside of it bounds. + float radius = isQsb + ? viewBounds.height() / 2f + : 0f; float stashedRadius = stashedRect.height() / 2f; return new RoundedRectRevealOutlineProvider(radius, stashedRadius, viewBounds, stashedRect)