Builder

class Builder

A builder used to create a StockNotificationPanel. The created panel is configured by the properties of this builder.

Properties

Link copied to clipboard
var bodyText: LiveData<StringResolver?>

The text shown in the body section.

Link copied to clipboard

The creation time of the notification panel. This is similar to Android's Notification.Builder.setWhen. If null, the creation time of the notification panel is set to the current time.

Link copied to clipboard

The FrontendContext for a notification panel to communicate with the rest of the system.

Link copied to clipboard

The view model for the header section containing the thumbnail, title and description.

Link copied to clipboard

Whether the notification panel is dismissible by the user.

Link copied to clipboard
var onAttached: () -> Unit?

A callback to be invoked when the panel is attached.

Link copied to clipboard
var onDismiss: () -> Unit?

A callback to be invoked when the panel is dismissed.

Link copied to clipboard
var onSuppress: () -> Unit?

A callback to be invoked when the notification panel is suppressed. The notification panel may be suppressed to avoid distractions. This call back may be called multiple times.

Link copied to clipboard

The view models for options in the options section. Each view model populates an additional item in the options section. Each item represents one option a user can choose from(e.g. send quick replies, an option given by VPA, etc.).

Link copied to clipboard
var primaryActionButtonViewModel: LiveData<TtButtonViewModel?>

The view model for the primary button in the button section.

Link copied to clipboard
Link copied to clipboard
var secondaryActionButtonViewModel: LiveData<TtButtonViewModel?>

The view model for the secondary action button in the button section.

Link copied to clipboard

If true, the notification is shown as heads-up notification. If false, the notification is not shown as heads-up notification. In this case showInNotificationCenter must be true. The default value is true.

Link copied to clipboard

If true, the notification is shown in the notification center. If false, the notification is not shown in the notification center. In this case showAsHeadsUpNotification must be true. The default value is true.

Functions

Link copied to clipboard
fun setBodyText(text: StringResolver)

Set bodyText to the given text.

Link copied to clipboard
fun setPrimaryActionButtonViewModel(viewModel: TtButtonViewModel)
Link copied to clipboard
fun setSecondaryActionButtonViewModel(viewModel: TtButtonViewModel)