Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aca3841 authored by Sergey Serokurov's avatar Sergey Serokurov Committed by Automerger Merge Worker
Browse files

Merge "Use bitmap width for bubble icon and app badge to calculate...

Merge "Use bitmap width for bubble icon and app badge to calculate translation" into tm-dev am: eadf6886 am: d2fb80fd am: 7f5ae374

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18244160



Change-Id: I4f71f75712c371c3e7d424dfc632b53fbbc603a9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0ceee29a 7f5ae374
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);
    }