public static final class NotificationActionButton.Builder extends Object
NotificationActionButton object.SystemCapability.Notification#ANS| 构造器 | 说明 |
|---|---|
Builder(NotificationActionButton actionButton) |
A constructor used to create a
Builder instance by copying parameters from an existing
NotificationActionButton object. |
Builder(PixelMap icon,
String title,
IntentAgent intentAgent) |
A constructor used to create a
Builder instance with the specified icon, title, and
IntentAgent for creating NotificationActionButton objects. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
NotificationActionButton.Builder |
addAdditionalData(PacMap pacMap) |
Adds additional data to this
Builder. |
NotificationActionButton.Builder |
addNotificationUserInput(NotificationUserInput userInput) |
Adds a
NotificationUserInput object used to collect user input. |
NotificationActionButton |
build() |
Uses all of the settings to create a new
NotificationActionButton object. |
NotificationActionButton.Builder |
setAutoCreatedReplies(boolean autoCreatedReplies) |
Sets whether to allow the platform to automatically generate possible replies and add them to
NotificationUserInput#getOptions(). |
NotificationActionButton.Builder |
setContextDependent(boolean isContextual) |
Sets whether this
NotificationActionButton is a contextual action, that is,
whether this NotificationActionButton is dependent on the notification message body. |
NotificationActionButton.Builder |
setSemanticActionButton(NotificationConstant.SemanticActionButton semanticActionButton) |
Sets a semantic action for this
NotificationActionButton. |
public Builder(PixelMap icon, String title, IntentAgent intentAgent)
Builder instance with the specified icon, title, and
IntentAgent for creating NotificationActionButton objects.icon - Indicates the icon to represent this NotificationActionButton.title - Indicates the title of this NotificationActionButton.intentAgent - Indicates the IntentAgent to be triggered when this
NotificationActionButton is triggered.public Builder(NotificationActionButton actionButton)
Builder instance by copying parameters from an existing
NotificationActionButton object.actionButton - Indicates the existing NotificationActionButton object.public NotificationActionButton.Builder addNotificationUserInput(NotificationUserInput userInput)
NotificationUserInput object used to collect user input.userInput - Indicates the NotificationUserInput object to add.Builder object.public NotificationActionButton.Builder setContextDependent(boolean isContextual)
NotificationActionButton is a contextual action, that is,
whether this NotificationActionButton is dependent on the notification message body. For example,
a contextual NotificationActionButton provides an address in the notification for users to
open a map application.isContextual - Specifies whether this NotificationActionButton is a contextual action.
The value true indicates a contextual action, and the value false indicates not.Builder object.public NotificationActionButton.Builder setSemanticActionButton(NotificationConstant.SemanticActionButton semanticActionButton)
NotificationActionButton.semanticActionButton - Indicates the semantic action to add. For available values,
see NotificationConstant.SemanticActionButton.Builder object.public NotificationActionButton.Builder setAutoCreatedReplies(boolean autoCreatedReplies)
NotificationUserInput#getOptions().autoCreatedReplies - Specifies whether to allow the platform to automatically generate possible
replies. The value true means to allow generated replies; and the value false means not.Builder object.public NotificationActionButton.Builder addAdditionalData(PacMap pacMap)
Builder.pacMap - Indicates the PacMap object containing the additional data.Builder object.public NotificationActionButton build()
NotificationActionButton object.NotificationActionButton object.IllegalArgumentException - Throws this exception if NotificationActionButton.isContextDependent() is true but
icon or intentAgent is null.