public final class

NotificationCompat.Action.WearableExtender

extends java.lang.Object

implements NotificationCompat.Action.Extender

 java.lang.Object

↳androidx.core.app.NotificationCompat.Action.WearableExtender

Overview

Wearable extender for notification actions. To add extensions to an action, create a new NotificationCompat.Action.WearableExtender object using the WearableExtender() constructor and apply it to a NotificationCompat.Action.Builder using NotificationCompat.Action.Builder.extend(NotificationCompat.Action.Extender).

 NotificationCompat.Action action = new NotificationCompat.Action.Builder(
         R.drawable.archive_all, "Archive all", actionIntent)
         .extend(new NotificationCompat.Action.WearableExtender()
                 .setAvailableOffline(false))
         .build();

Summary

Constructors
publicWearableExtender()

Create a NotificationCompat.Action.WearableExtender with default options.

publicWearableExtender(NotificationCompat.Action action)

Create a NotificationCompat.Action.WearableExtender by reading wearable options present in an existing notification action.

Methods
public NotificationCompat.Action.WearableExtenderclone()

public NotificationCompat.Action.Builderextend(NotificationCompat.Action.Builder builder)

Apply wearable extensions to a notification action that is being built.

public java.lang.CharSequencegetCancelLabel()

Get the label to display to cancel the action.

public java.lang.CharSequencegetConfirmLabel()

Get the label to display to confirm that the action should be executed.

public booleangetHintDisplayActionInline()

Get a hint that this Action should be displayed inline - i.e.

public booleangetHintLaunchesActivity()

Get a hint that this Action will launch an directly, telling the platform that it can generate the appropriate transitions

public java.lang.CharSequencegetInProgressLabel()

Get the label to display while the wearable is preparing to automatically execute the action.

public booleanisAvailableOffline()

Get whether this action is available when the wearable device is not connected to a companion device.

public NotificationCompat.Action.WearableExtendersetAvailableOffline(boolean availableOffline)

Set whether this action is available when the wearable device is not connected to a companion device.

public NotificationCompat.Action.WearableExtendersetCancelLabel(java.lang.CharSequence label)

Set a label to display to cancel the action.

public NotificationCompat.Action.WearableExtendersetConfirmLabel(java.lang.CharSequence label)

Set a label to display to confirm that the action should be executed.

public NotificationCompat.Action.WearableExtendersetHintDisplayActionInline(boolean hintDisplayInline)

Set a hint that this Action should be displayed inline - i.e.

public NotificationCompat.Action.WearableExtendersetHintLaunchesActivity(boolean hintLaunchesActivity)

Set a hint that this Action will launch an directly, telling the platform that it can generate the appropriate transitions.

public NotificationCompat.Action.WearableExtendersetInProgressLabel(java.lang.CharSequence label)

Set a label to display while the wearable is preparing to automatically execute the action.

from java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public WearableExtender()

Create a NotificationCompat.Action.WearableExtender with default options.

public WearableExtender(NotificationCompat.Action action)

Create a NotificationCompat.Action.WearableExtender by reading wearable options present in an existing notification action.

Parameters:

action: the notification action to inspect.

Methods

Apply wearable extensions to a notification action that is being built. This is typically called by the NotificationCompat.Action.Builder.extend(NotificationCompat.Action.Extender) method of NotificationCompat.Action.Builder.

public NotificationCompat.Action.WearableExtender setAvailableOffline(boolean availableOffline)

Set whether this action is available when the wearable device is not connected to a companion device. The user can still trigger this action when the wearable device is offline, but a visual hint will indicate that the action may not be available. Defaults to true.

public boolean isAvailableOffline()

Get whether this action is available when the wearable device is not connected to a companion device. The user can still trigger this action when the wearable device is offline, but a visual hint will indicate that the action may not be available. Defaults to true.

public NotificationCompat.Action.WearableExtender setInProgressLabel(java.lang.CharSequence label)

Deprecated: This method has no effect starting with Wear 2.0.

Set a label to display while the wearable is preparing to automatically execute the action. This is usually a 'ing' verb ending in ellipsis like "Sending..."

Parameters:

label: the label to display while the action is being prepared to execute

Returns:

this object for method chaining

public java.lang.CharSequence getInProgressLabel()

Deprecated: This method has no effect starting with Wear 2.0.

Get the label to display while the wearable is preparing to automatically execute the action. This is usually a 'ing' verb ending in ellipsis like "Sending..."

Returns:

the label to display while the action is being prepared to execute

public NotificationCompat.Action.WearableExtender setConfirmLabel(java.lang.CharSequence label)

Deprecated: This method has no effect starting with Wear 2.0.

Set a label to display to confirm that the action should be executed. This is usually an imperative verb like "Send".

Parameters:

label: the label to confirm the action should be executed

Returns:

this object for method chaining

public java.lang.CharSequence getConfirmLabel()

Deprecated: This method has no effect starting with Wear 2.0.

Get the label to display to confirm that the action should be executed. This is usually an imperative verb like "Send".

Returns:

the label to confirm the action should be executed

public NotificationCompat.Action.WearableExtender setCancelLabel(java.lang.CharSequence label)

Deprecated: This method has no effect starting with Wear 2.0.

Set a label to display to cancel the action. This is usually an imperative verb, like "Cancel".

Parameters:

label: the label to display to cancel the action

Returns:

this object for method chaining

public java.lang.CharSequence getCancelLabel()

Deprecated: This method has no effect starting with Wear 2.0.

Get the label to display to cancel the action. This is usually an imperative verb like "Cancel".

Returns:

the label to display to cancel the action

public NotificationCompat.Action.WearableExtender setHintLaunchesActivity(boolean hintLaunchesActivity)

Set a hint that this Action will launch an directly, telling the platform that it can generate the appropriate transitions.

Parameters:

hintLaunchesActivity: true if the content intent will launch an activity and transitions should be generated, false otherwise.

Returns:

this object for method chaining

public boolean getHintLaunchesActivity()

Get a hint that this Action will launch an directly, telling the platform that it can generate the appropriate transitions

Returns:

true if the content intent will launch an activity and transitions should be generated, false otherwise. The default value is false if this was never set.

public NotificationCompat.Action.WearableExtender setHintDisplayActionInline(boolean hintDisplayInline)

Set a hint that this Action should be displayed inline - i.e. it will have a visual representation directly on the notification surface in addition to the expanded Notification

Parameters:

hintDisplayInline: true if action should be displayed inline, false otherwise

Returns:

this object for method chaining

public boolean getHintDisplayActionInline()

Get a hint that this Action should be displayed inline - i.e. it should have a visual representation directly on the notification surface in addition to the expanded Notification

Returns:

true if the Action should be displayed inline, false otherwise. The default value is false if this was never set.