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

Commit 787445d9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Include app badge without markings in bubble data"

parents 765be286 4311ec42
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@ public class Bubble implements BubbleViewProvider {
    private Bitmap mBubbleBitmap;
    // The app badge for the bubble
    private Bitmap mBadgeBitmap;
    // App badge without any markings for important conversations
    private Bitmap mRawBadgeBitmap;
    private int mDotColor;
    private Path mDotPath;
    private int mFlags;
@@ -247,6 +249,11 @@ public class Bubble implements BubbleViewProvider {
        return mBadgeBitmap;
    }

    @Override
    public Bitmap getRawAppBadge() {
        return mRawBadgeBitmap;
    }

    @Override
    public int getDotColor() {
        return mDotColor;
@@ -409,6 +416,7 @@ public class Bubble implements BubbleViewProvider {
        mFlyoutMessage = info.flyoutMessage;

        mBadgeBitmap = info.badgeBitmap;
        mRawBadgeBitmap = info.mRawBadgeBitmap;
        mBubbleBitmap = info.bubbleBitmap;

        mDotColor = info.dotColor;
+4 −0
Original line number Diff line number Diff line
@@ -141,6 +141,10 @@ class BubbleOverflow(
        return null
    }

    override fun getRawAppBadge(): Bitmap? {
        return null
    }

    override fun getBubbleIcon(): Bitmap {
        return bitmap
    }
+6 −4
Original line number Diff line number Diff line
@@ -2615,12 +2615,14 @@ public class BubbleStackView extends FrameLayout

        // If available, update the manage menu's settings option with the expanded bubble's app
        // name and icon.
        if (show && mBubbleData.hasBubbleInStackWithKey(mExpandedBubble.getKey())) {
        if (show) {
            final Bubble bubble = mBubbleData.getBubbleInStackWithKey(mExpandedBubble.getKey());
            mManageSettingsIcon.setImageBitmap(bubble.getAppBadge());
            if (bubble != null) {
                mManageSettingsIcon.setImageBitmap(bubble.getRawAppBadge());
                mManageSettingsText.setText(getResources().getString(
                        R.string.bubbles_app_settings, bubble.getAppName()));
            }
        }

        if (mExpandedBubble.getExpandedView().getTaskView() != null) {
            mExpandedBubble.getExpandedView().getTaskView().setObscuredTouchRect(mShowingManage
+3 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class BubbleViewInfoTask extends AsyncTask<Void, Void, BubbleViewInfoTask
        String appName;
        Bitmap bubbleBitmap;
        Bitmap badgeBitmap;
        Bitmap mRawBadgeBitmap;
        int dotColor;
        Path dotPath;
        Bubble.FlyoutMessage flyoutMessage;
@@ -189,6 +190,8 @@ public class BubbleViewInfoTask extends AsyncTask<Void, Void, BubbleViewInfoTask
            BitmapInfo badgeBitmapInfo = iconFactory.getBadgeBitmap(badgedIcon,
                    b.isImportantConversation());
            info.badgeBitmap = badgeBitmapInfo.icon;
            // Raw badge bitmap never includes the important conversation ring
            info.mRawBadgeBitmap = iconFactory.getBadgeBitmap(badgedIcon, false).icon;
            info.bubbleBitmap = iconFactory.createBadgedIconBitmap(bubbleDrawable).icon;

            // Dot color & placement
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ public interface BubbleViewProvider {
    /** App badge drawable to draw above bubble icon. */
    @Nullable Bitmap getAppBadge();

    /** Base app badge drawable without any markings. */
    @Nullable Bitmap getRawAppBadge();

    /** Path of normalized bubble icon to draw dot on. */
    Path getDotPath();