diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index af371f25e7..974d56531b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -970,11 +970,14 @@ public class BubbleBarView extends FrameLayout { float fullElevationForChild = (MAX_BUBBLES * mBubbleElevation) - i; bv.setZ(fullElevationForChild * elevationState); - // only update the dot scale if we're expanding or collapsing + // only update the dot and badge scale if we're expanding or collapsing if (mWidthAnimator.isRunning()) { // The dot for the selected bubble scales in the opposite direction of the expansion // animation. bv.showDotIfNeeded(bv == mSelectedBubbleView ? 1 - widthState : widthState); + // The badge for the selected bubble is always at full scale. All other bubbles + // scale according to the expand animation. + bv.setBadgeScale(bv == mSelectedBubbleView ? 1 : widthState); } if (mIsBarExpanded) { @@ -983,16 +986,12 @@ public class BubbleBarView extends FrameLayout { // where the bubble will end up when the animation ends final float targetX = expandedX + expandedBarShift; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); - // When we're expanded, the badge is visible for all bubbles - bv.updateBadgeVisibility(/* show= */ true); bv.setAlpha(1); } else { // If bar is on the right, account for bubble bar expanding and shifting left final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth; final float targetX = collapsedX + collapsedBarShift; bv.setTranslationX(widthState * (expandedX - targetX) + targetX); - // The badge is always visible for the first bubble - bv.updateBadgeVisibility(/* show= */ i == 0); // If we're fully collapsed, hide all bubbles except for the first 2. If there are // only 2 bubbles, hide the second bubble as well because it's the overflow. if (widthState == 0) { diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java index 6db42a4c53..9c427e78e5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java @@ -300,18 +300,9 @@ public class BubbleView extends ConstraintLayout { } } - void updateBadgeVisibility(boolean show) { - if (mBubble instanceof BubbleBarOverflow) { - // The overflow bubble does not have a badge, so just bail. - return; - } - BubbleBarBubble bubble = (BubbleBarBubble) mBubble; - Bitmap appBadgeBitmap = bubble.getBadge(); - int translationX = mOnLeft - ? -(bubble.getIcon().getWidth() - appBadgeBitmap.getWidth()) - : 0; - mAppIcon.setTranslationX(translationX); - mAppIcon.setVisibility(show ? VISIBLE : GONE); + void setBadgeScale(float fraction) { + mAppIcon.setScaleX(fraction); + mAppIcon.setScaleY(fraction); } boolean hasUnseenContent() {