Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt +4 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,11 @@ package com.android.launcher3.taskbar.bubbles import android.graphics.Bitmap import android.graphics.Path import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutMessage import com.android.wm.shell.shared.bubbles.BubbleInfo /** An entity in the bubble bar. */ sealed class BubbleBarItem(open var key: String, open var view: BubbleView) sealed class BubbleBarItem(open val key: String, open var view: BubbleView) /** Contains state info about a bubble in the bubble bar as well as presentation information. */ data class BubbleBarBubble( Loading @@ -30,7 +31,8 @@ data class BubbleBarBubble( var icon: Bitmap, var dotColor: Int, var dotPath: Path, var appName: String var appName: String, var flyoutMessage: BubbleBarFlyoutMessage?, ) : BubbleBarItem(info.key, view) /** Represents the overflow bubble in the bubble bar. */ Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleCreator.java +22 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER; import static com.android.launcher3.icons.FastBitmapDrawable.WHITE_SCRIM_ALPHA; import static com.android.wm.shell.shared.bubbles.FlyoutDrawableLoader.loadFlyoutDrawable; import android.annotation.Nullable; import android.content.Context; Loading Loading @@ -49,7 +50,9 @@ import com.android.launcher3.R; import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BubbleIconFactory; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutMessage; import com.android.wm.shell.shared.bubbles.BubbleInfo; import com.android.wm.shell.shared.bubbles.ParcelableFlyoutMessage; /** * Loads the necessary info to populate / present a bubble (name, icon, shortcut). Loading Loading @@ -157,13 +160,16 @@ public class BubbleCreator { dotColor = ColorUtils.blendARGB(badgeBitmapInfo.color, Color.WHITE, WHITE_SCRIM_ALPHA / 255f); final BubbleBarFlyoutMessage flyoutMessage = getFlyoutMessage(info.getParcelableFlyoutMessage()); if (existingBubble == null) { LayoutInflater inflater = LayoutInflater.from(context); BubbleView bubbleView = (BubbleView) inflater.inflate( R.layout.bubblebar_item_view, barView, false /* attachToRoot */); BubbleBarBubble bubble = new BubbleBarBubble(info, bubbleView, badgeBitmap, bubbleBitmap, dotColor, dotPath, appName); badgeBitmap, bubbleBitmap, dotColor, dotPath, appName, flyoutMessage); bubbleView.setBubble(bubble); return bubble; } else { Loading @@ -174,10 +180,25 @@ public class BubbleCreator { existingBubble.setDotColor(dotColor); existingBubble.setDotPath(dotPath); existingBubble.setAppName(appName); existingBubble.setFlyoutMessage(flyoutMessage); return existingBubble; } } @Nullable private BubbleBarFlyoutMessage getFlyoutMessage( @Nullable ParcelableFlyoutMessage parcelableFlyoutMessage) { if (parcelableFlyoutMessage == null) { return null; } String title = parcelableFlyoutMessage.getTitle(); String message = parcelableFlyoutMessage.getMessage(); return new BubbleBarFlyoutMessage( loadFlyoutDrawable(parcelableFlyoutMessage.getIcon(), mContext), title == null ? "" : title, message == null ? "" : message); } /** * Creates the overflow view shown in the bubble bar. * Loading quickstep/testing/com/android/launcher3/taskbar/bubbles/testing/FakeBubbleViewFactory.kt +10 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,16 @@ object FakeBubbleViewFactory { context.resources.getString(com.android.internal.R.string.config_icon_mask) ) val bubble = BubbleBarBubble(bubbleInfo, bubbleView, badge, icon, dotColor, dotPath, "test app") BubbleBarBubble( bubbleInfo, bubbleView, badge, icon, dotColor, dotPath, "test app", null, ) bubbleView.setBubble(bubble) return bubbleView } Loading quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,16 @@ class BubbleViewTest { ) bubbleView = inflater.inflate(R.layout.bubblebar_item_view, null, false) as BubbleView bubble = BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "") BubbleBarBubble( bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "", null, ) bubbleView.setBubble(bubble) } InstrumentationRegistry.getInstrumentation().waitForIdleSync() Loading quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -886,7 +886,16 @@ class BubbleBarViewAnimatorTest { bubbleView = inflater.inflate(R.layout.bubblebar_item_view, bubbleBarView, false) as BubbleView bubble = BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "") BubbleBarBubble( bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "", null, ) bubbleView.setBubble(bubble) bubbleBarView.addView(bubbleView) } Loading Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt +4 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,11 @@ package com.android.launcher3.taskbar.bubbles import android.graphics.Bitmap import android.graphics.Path import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutMessage import com.android.wm.shell.shared.bubbles.BubbleInfo /** An entity in the bubble bar. */ sealed class BubbleBarItem(open var key: String, open var view: BubbleView) sealed class BubbleBarItem(open val key: String, open var view: BubbleView) /** Contains state info about a bubble in the bubble bar as well as presentation information. */ data class BubbleBarBubble( Loading @@ -30,7 +31,8 @@ data class BubbleBarBubble( var icon: Bitmap, var dotColor: Int, var dotPath: Path, var appName: String var appName: String, var flyoutMessage: BubbleBarFlyoutMessage?, ) : BubbleBarItem(info.key, view) /** Represents the overflow bubble in the bubble bar. */ Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleCreator.java +22 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER; import static com.android.launcher3.icons.FastBitmapDrawable.WHITE_SCRIM_ALPHA; import static com.android.wm.shell.shared.bubbles.FlyoutDrawableLoader.loadFlyoutDrawable; import android.annotation.Nullable; import android.content.Context; Loading Loading @@ -49,7 +50,9 @@ import com.android.launcher3.R; import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BubbleIconFactory; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutMessage; import com.android.wm.shell.shared.bubbles.BubbleInfo; import com.android.wm.shell.shared.bubbles.ParcelableFlyoutMessage; /** * Loads the necessary info to populate / present a bubble (name, icon, shortcut). Loading Loading @@ -157,13 +160,16 @@ public class BubbleCreator { dotColor = ColorUtils.blendARGB(badgeBitmapInfo.color, Color.WHITE, WHITE_SCRIM_ALPHA / 255f); final BubbleBarFlyoutMessage flyoutMessage = getFlyoutMessage(info.getParcelableFlyoutMessage()); if (existingBubble == null) { LayoutInflater inflater = LayoutInflater.from(context); BubbleView bubbleView = (BubbleView) inflater.inflate( R.layout.bubblebar_item_view, barView, false /* attachToRoot */); BubbleBarBubble bubble = new BubbleBarBubble(info, bubbleView, badgeBitmap, bubbleBitmap, dotColor, dotPath, appName); badgeBitmap, bubbleBitmap, dotColor, dotPath, appName, flyoutMessage); bubbleView.setBubble(bubble); return bubble; } else { Loading @@ -174,10 +180,25 @@ public class BubbleCreator { existingBubble.setDotColor(dotColor); existingBubble.setDotPath(dotPath); existingBubble.setAppName(appName); existingBubble.setFlyoutMessage(flyoutMessage); return existingBubble; } } @Nullable private BubbleBarFlyoutMessage getFlyoutMessage( @Nullable ParcelableFlyoutMessage parcelableFlyoutMessage) { if (parcelableFlyoutMessage == null) { return null; } String title = parcelableFlyoutMessage.getTitle(); String message = parcelableFlyoutMessage.getMessage(); return new BubbleBarFlyoutMessage( loadFlyoutDrawable(parcelableFlyoutMessage.getIcon(), mContext), title == null ? "" : title, message == null ? "" : message); } /** * Creates the overflow view shown in the bubble bar. * Loading
quickstep/testing/com/android/launcher3/taskbar/bubbles/testing/FakeBubbleViewFactory.kt +10 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,16 @@ object FakeBubbleViewFactory { context.resources.getString(com.android.internal.R.string.config_icon_mask) ) val bubble = BubbleBarBubble(bubbleInfo, bubbleView, badge, icon, dotColor, dotPath, "test app") BubbleBarBubble( bubbleInfo, bubbleView, badge, icon, dotColor, dotPath, "test app", null, ) bubbleView.setBubble(bubble) return bubbleView } Loading
quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,16 @@ class BubbleViewTest { ) bubbleView = inflater.inflate(R.layout.bubblebar_item_view, null, false) as BubbleView bubble = BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "") BubbleBarBubble( bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "", null, ) bubbleView.setBubble(bubble) } InstrumentationRegistry.getInstrumentation().waitForIdleSync() Loading
quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -886,7 +886,16 @@ class BubbleBarViewAnimatorTest { bubbleView = inflater.inflate(R.layout.bubblebar_item_view, bubbleBarView, false) as BubbleView bubble = BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "") BubbleBarBubble( bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "", null, ) bubbleView.setBubble(bubble) bubbleBarView.addView(bubbleView) } Loading