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
var frontendContext: FrontendContext? = null

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

Link copied to clipboard
var headerViewModel: NotificationViewModel.HeaderViewModel? = null

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

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

A callback to be invoked when the panel is dismissed.

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
var priority: NotificationPanel.Priority? = null

The NotificationPanel.Priority of a notification panel.

Link copied to clipboard

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

Functions

Link copied to clipboard
fun setBodyText(text: StringResolver)

Set bodyText to the given text.

Link copied to clipboard
fun setOptionViewModels(viewModels: List<NotificationViewModel.OptionViewModel>)

Set optionViewModels to the given viewModels.

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