diff options
| author | 2022-05-10 21:07:03 +0000 | |
|---|---|---|
| committer | 2022-05-10 21:07:03 +0000 | |
| commit | fb815518b0fa0905d876a91bc5d7cce2f24fce82 (patch) | |
| tree | 18cbfec8660269974a94bf9ad26501d6cb6249ff | |
| parent | dc1d353bc7619565492e4245f3f964777f28bb7a (diff) | |
| parent | eadf6886212c4918bb135b1e3f94a24fb4ac11e4 (diff) | |
Merge "Use bitmap width for bubble icon and app badge to calculate translation" into tm-dev am: eadf688621
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18244160
Change-Id: I5cca1fe905d026d8e58d8db09ea4dd6bdd4bb298
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java index 3876533a922e..b04a1fa93bbd 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java @@ -19,6 +19,7 @@ import android.annotation.DrawableRes; import android.annotation.Nullable; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Outline; import android.graphics.Path; @@ -350,16 +351,19 @@ public class BadgedImageView extends ConstraintLayout { } void showBadge() { - if (mBubble.getAppBadge() == null) { + Bitmap appBadgeBitmap = mBubble.getAppBadge(); + if (appBadgeBitmap == null) { mAppIcon.setVisibility(GONE); return; } + int translationX; if (mOnLeft) { - translationX = -(mBubbleIcon.getWidth() - mAppIcon.getWidth()); + translationX = -(mBubble.getBubbleIcon().getWidth() - appBadgeBitmap.getWidth()); } else { translationX = 0; } + mAppIcon.setTranslationX(translationX); mAppIcon.setVisibility(VISIBLE); } |