Loading packages/SystemUI/src/com/android/systemui/bubbles/Bubble.java +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Parcelable; import android.os.UserHandle; import android.provider.Settings; Loading @@ -55,6 +56,7 @@ class Bubble { private final String mKey; private final String mGroupId; private String mAppName; private Drawable mUserBadgedAppIcon; private boolean mInflated; private BubbleView mIconView; Loading Loading @@ -105,6 +107,8 @@ class Bubble { if (info != null) { mAppName = String.valueOf(pm.getApplicationLabel(info)); } Drawable appIcon = pm.getApplicationIcon(mEntry.notification.getPackageName()); mUserBadgedAppIcon = pm.getUserBadgedIcon(appIcon, mEntry.notification.getUser()); } catch (PackageManager.NameNotFoundException unused) { mAppName = mEntry.notification.getPackageName(); } Loading Loading @@ -161,6 +165,7 @@ class Bubble { mIconView = (BubbleView) inflater.inflate( R.layout.bubble_view, stackView, false /* attachToRoot */); mIconView.setBubble(this); mIconView.setAppIcon(mUserBadgedAppIcon); mExpandedView = (BubbleExpandedView) inflater.inflate( R.layout.bubble_expanded_view, stackView, false /* attachToRoot */); Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java +9 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.bubbles; import android.annotation.Nullable; import android.app.Notification; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Path; Loading @@ -32,7 +33,6 @@ import android.util.PathParser; import android.widget.FrameLayout; import com.android.internal.graphics.ColorUtils; import com.android.launcher3.icons.BitmapInfo; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading @@ -53,6 +53,7 @@ public class BubbleView extends FrameLayout { private BadgedImageView mBadgedImageView; private int mBadgeColor; private int mIconInset; private Drawable mUserBadgedAppIcon; // mBubbleIconFactory cannot be static because it depends on Context. private BubbleIconFactory mBubbleIconFactory; Loading Loading @@ -133,6 +134,9 @@ public class BubbleView extends FrameLayout { mBubbleIconFactory = factory; } public void setAppIcon(Drawable appIcon) { mUserBadgedAppIcon = appIcon; } /** * @return the {@link ExpandableNotificationRow} view to display notification content when the * bubble is expanded. Loading Loading @@ -228,10 +232,11 @@ public class BubbleView extends FrameLayout { if (needsTint) { iconDrawable = buildIconWithTint(iconDrawable, n.color); } BitmapInfo bitmapInfo = mBubbleIconFactory.createBadgedIconBitmap(iconDrawable, Bitmap bubbleIcon = mBubbleIconFactory.createBadgedIconBitmap(iconDrawable, null /* user */, true /* shrinkNonAdaptiveIcons */); mBadgedImageView.setImageBitmap(bitmapInfo.icon); true /* shrinkNonAdaptiveIcons */).icon; mBubbleIconFactory.badgeWithDrawable(bubbleIcon, mUserBadgedAppIcon); mBadgedImageView.setImageBitmap(bubbleIcon); // Update badge. int badgeColor = determineDominateColor(iconDrawable, n.color); Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/Bubble.java +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Parcelable; import android.os.UserHandle; import android.provider.Settings; Loading @@ -55,6 +56,7 @@ class Bubble { private final String mKey; private final String mGroupId; private String mAppName; private Drawable mUserBadgedAppIcon; private boolean mInflated; private BubbleView mIconView; Loading Loading @@ -105,6 +107,8 @@ class Bubble { if (info != null) { mAppName = String.valueOf(pm.getApplicationLabel(info)); } Drawable appIcon = pm.getApplicationIcon(mEntry.notification.getPackageName()); mUserBadgedAppIcon = pm.getUserBadgedIcon(appIcon, mEntry.notification.getUser()); } catch (PackageManager.NameNotFoundException unused) { mAppName = mEntry.notification.getPackageName(); } Loading Loading @@ -161,6 +165,7 @@ class Bubble { mIconView = (BubbleView) inflater.inflate( R.layout.bubble_view, stackView, false /* attachToRoot */); mIconView.setBubble(this); mIconView.setAppIcon(mUserBadgedAppIcon); mExpandedView = (BubbleExpandedView) inflater.inflate( R.layout.bubble_expanded_view, stackView, false /* attachToRoot */); Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java +9 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.bubbles; import android.annotation.Nullable; import android.app.Notification; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Path; Loading @@ -32,7 +33,6 @@ import android.util.PathParser; import android.widget.FrameLayout; import com.android.internal.graphics.ColorUtils; import com.android.launcher3.icons.BitmapInfo; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading @@ -53,6 +53,7 @@ public class BubbleView extends FrameLayout { private BadgedImageView mBadgedImageView; private int mBadgeColor; private int mIconInset; private Drawable mUserBadgedAppIcon; // mBubbleIconFactory cannot be static because it depends on Context. private BubbleIconFactory mBubbleIconFactory; Loading Loading @@ -133,6 +134,9 @@ public class BubbleView extends FrameLayout { mBubbleIconFactory = factory; } public void setAppIcon(Drawable appIcon) { mUserBadgedAppIcon = appIcon; } /** * @return the {@link ExpandableNotificationRow} view to display notification content when the * bubble is expanded. Loading Loading @@ -228,10 +232,11 @@ public class BubbleView extends FrameLayout { if (needsTint) { iconDrawable = buildIconWithTint(iconDrawable, n.color); } BitmapInfo bitmapInfo = mBubbleIconFactory.createBadgedIconBitmap(iconDrawable, Bitmap bubbleIcon = mBubbleIconFactory.createBadgedIconBitmap(iconDrawable, null /* user */, true /* shrinkNonAdaptiveIcons */); mBadgedImageView.setImageBitmap(bitmapInfo.icon); true /* shrinkNonAdaptiveIcons */).icon; mBubbleIconFactory.badgeWithDrawable(bubbleIcon, mUserBadgedAppIcon); mBadgedImageView.setImageBitmap(bubbleIcon); // Update badge. int badgeColor = determineDominateColor(iconDrawable, n.color); Loading