NotificationCompat.BubbleMetadata
public
static
final
class
NotificationCompat.BubbleMetadata
extends Object
java.lang.Object | |
↳ | 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,
NotificationCompat.BubbleMetadata.Builder.setIcon(IconCompat)
and an expanded state which is populated
via NotificationCompat.BubbleMetadata.Builder.setIntent(PendingIntent)
.
Summary
Nested classes | |
---|---|
class |
NotificationCompat.BubbleMetadata.Builder
Builder to construct a |
Public methods | |
---|---|
static
NotificationCompat.BubbleMetadata
|
fromPlatform(Notification.BubbleMetadata platformMetadata)
Converts a platform-level |
boolean
|
getAutoExpandBubble()
|
PendingIntent
|
getDeleteIntent()
|
int
|
getDesiredHeight()
|
int
|
getDesiredHeightResId()
|
IconCompat
|
getIcon()
|
PendingIntent
|
getIntent()
|
String
|
getShortcutId()
|
boolean
|
isNotificationSuppressed()
|
static
Notification.BubbleMetadata
|
toPlatform(NotificationCompat.BubbleMetadata compatMetadata)
Converts a |
Inherited methods | |
---|---|
Public methods
fromPlatform
public static NotificationCompat.BubbleMetadata fromPlatform (Notification.BubbleMetadata platformMetadata)
Converts a platform-level Notification.BubbleMetadata
to a
NotificationCompat.BubbleMetadata
.
Parameters | |
---|---|
platformMetadata |
Notification.BubbleMetadata : the Notification.BubbleMetadata to convert |
Returns | |
---|---|
NotificationCompat.BubbleMetadata |
a NotificationCompat.BubbleMetadata containing the same data if
platformMetadata is non-null, otherwise null.
|
getAutoExpandBubble
public boolean getAutoExpandBubble ()
Returns | |
---|---|
boolean |
whether this bubble should auto expand when it is posted. |
getDeleteIntent
public PendingIntent getDeleteIntent ()
Returns | |
---|---|
PendingIntent |
the pending intent to send when the bubble is dismissed by a user, if one exists. |
getDesiredHeight
public int getDesiredHeight ()
Returns | |
---|---|
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
public int getDesiredHeightResId ()
Returns | |
---|---|
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
public IconCompat getIcon ()
Returns | |
---|---|
IconCompat |
the icon that will be displayed for this bubble when it is collapsed, or null
if the bubble is created via NotificationCompat.BubbleMetadata.Builder.Builder(String) .
|
getIntent
public PendingIntent getIntent ()
Returns | |
---|---|
PendingIntent |
the pending intent used to populate the floating window for this bubble, or
null if this bubble is created via NotificationCompat.BubbleMetadata.Builder.Builder(String) .
|
getShortcutId
public String getShortcutId ()
Returns | |
---|---|
String |
the shortcut id used for this bubble if created via
NotificationCompat.BubbleMetadata.Builder.Builder(String) or null if created via
NotificationCompat.BubbleMetadata.Builder.Builder(PendingIntent, IconCompat) .
|
isNotificationSuppressed
public boolean isNotificationSuppressed ()
Returns | |
---|---|
boolean |
whether this bubble should suppress the notification when it is posted. |
toPlatform
public static Notification.BubbleMetadata toPlatform (NotificationCompat.BubbleMetadata compatMetadata)
Converts a NotificationCompat.BubbleMetadata
to a platform-level
Notification.BubbleMetadata
.
Parameters | |
---|---|
compatMetadata |
NotificationCompat.BubbleMetadata : the NotificationCompat.BubbleMetadata to convert |
Returns | |
---|---|
Notification.BubbleMetadata |
a Notification.BubbleMetadata containing the same data if compatMetadata
is non-null, otherwise null.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-11-11 UTC.