BubbleMetadata
class BubbleMetadata
kotlin.Any | |
↳ | androidx.core.app.NotificationCompat.BubbleMetadata |
Encapsulates the information needed to display a notification as a bubble.
A bubble is used to display app content in a floating window over the existing foreground activity. A bubble has a collapsed state represented by an icon, BubbleMetadata.Builder#setIcon(IconCompat)
and an expanded state which is populated via BubbleMetadata.Builder#setIntent(PendingIntent)
.
Summary
Nested classes | |
---|---|
Builder to construct a |
Public methods | |
---|---|
static NotificationCompat.BubbleMetadata? |
fromPlatform(@Nullable platformMetadata: BubbleMetadata?) Converts a platform-level |
Boolean | |
PendingIntent? | |
Int | |
Int | |
IconCompat? |
getIcon() |
PendingIntent? | |
String? | |
Boolean | |
static BubbleMetadata? |
toPlatform(@Nullable compatMetadata: NotificationCompat.BubbleMetadata?) Converts a |
Public methods
fromPlatform
@Nullable static fun fromPlatform(@Nullable platformMetadata: BubbleMetadata?): NotificationCompat.BubbleMetadata?
Converts a platform-level Notification.BubbleMetadata
to a NotificationCompat.BubbleMetadata
.
Parameters | |
---|---|
platformMetadata |
BubbleMetadata?: the Notification.BubbleMetadata to convert |
Return | |
---|---|
NotificationCompat.BubbleMetadata? |
a NotificationCompat.BubbleMetadata containing the same data if platformMetadata is non-null, otherwise null. |
getAutoExpandBubble
fun getAutoExpandBubble(): Boolean
Return | |
---|---|
Boolean |
whether this bubble should auto expand when it is posted. |
getDeleteIntent
@Nullable fun getDeleteIntent(): PendingIntent?
Return | |
---|---|
PendingIntent? |
the pending intent to send when the bubble is dismissed by a user, if one exists. |
getDesiredHeight
@Dimension(0) fun getDesiredHeight(): Int
Return | |
---|---|
Int |
the ideal height, in DPs, for the floating window that app content defined by getIntent() for this bubble. A value of 0 indicates a desired height has not been set. |
getDesiredHeightResId
@DimenRes fun getDesiredHeightResId(): Int
Return | |
---|---|
Int |
the resId of ideal height for the floating window that app content defined by getIntent() for this bubble. A value of 0 indicates a res value has not been provided for the desired height. |
getIcon
@Nullable fun getIcon(): IconCompat?
Return | |
---|---|
IconCompat? |
the icon that will be displayed for this bubble when it is collapsed, or null if the bubble is created via Builder#Builder(String) . |
getIntent
@Nullable fun getIntent(): PendingIntent?
Return | |
---|---|
PendingIntent? |
the pending intent used to populate the floating window for this bubble, or null if this bubble is created via Builder#Builder(String) . |
getShortcutId
@Nullable fun getShortcutId(): String?
Return | |
---|---|
String? |
the shortcut id used for this bubble if created via Builder#Builder(String) or null if created via Builder#Builder(PendingIntent, IconCompat) . |
isNotificationSuppressed
fun isNotificationSuppressed(): Boolean
Return | |
---|---|
Boolean |
whether this bubble should suppress the notification when it is posted. |
toPlatform
@Nullable static fun toPlatform(@Nullable compatMetadata: NotificationCompat.BubbleMetadata?): BubbleMetadata?
Converts a NotificationCompat.BubbleMetadata
to a platform-level Notification.BubbleMetadata
.
Parameters | |
---|---|
compatMetadata |
NotificationCompat.BubbleMetadata?: the NotificationCompat.BubbleMetadata to convert |
Return | |
---|---|
BubbleMetadata? |
a Notification.BubbleMetadata containing the same data if compatMetadata is non-null, otherwise null. |