SliceAction

@RequiresApi(value = 19)
public interface SliceAction

Known direct subclasses
SliceAction

Class representing an action, supports tappable icons, custom toggle icons, and default toggles, as well as date and time pickers.


Interface for a slice action, supports tappable icons, custom toggle icons, and default toggles.

Summary

Public methods

abstract @NonNull PendingIntent
abstract @Nullable CharSequence
abstract @Nullable IconCompat
abstract int
abstract int
abstract @NonNull CharSequence
abstract boolean
abstract boolean
abstract boolean
abstract boolean
abstract SliceAction
setChecked(boolean isChecked)
abstract @Nullable SliceAction
abstract SliceAction
setPriority(@IntRange(from = 0) int priority)

Sets the priority of this action, with the lowest priority having the highest ranking.

Public methods

getAction

Added in 1.1.0-alpha02
abstract @NonNull PendingIntent getAction()
Returns
@NonNull PendingIntent

the PendingIntent associated with this action.

getContentDescription

Added in 1.1.0-alpha02
abstract @Nullable CharSequence getContentDescription()
Returns
@Nullable CharSequence

the content description to use for this action.

getIcon

Added in 1.1.0-alpha02
abstract @Nullable IconCompat getIcon()
Returns
@Nullable IconCompat

the IconCompat to display for this action. This can be null when the action represented is a default toggle.

getImageMode

Added in 1.1.0-alpha02
abstract int getImageMode()
Returns
int

the image mode to use for this action.

getPriority

Added in 1.1.0-alpha02
abstract int getPriority()
Returns
int

the priority associated with this action, -1 if unset.

getTitle

Added in 1.1.0-alpha02
abstract @NonNull CharSequence getTitle()
Returns
@NonNull CharSequence

the title for this action.

isActivity

Added in 1.1.0-alpha02
abstract boolean isActivity()
Returns
boolean

whether this activity launches an activity or not.

isChecked

Added in 1.1.0-alpha02
abstract boolean isChecked()
Returns
boolean

whether the state of this action is checked or not; only used for toggle actions.

isDefaultToggle

Added in 1.1.0-alpha02
abstract boolean isDefaultToggle()
Returns
boolean

whether this action is a toggle using the standard switch control.

isToggle

Added in 1.1.0-alpha02
abstract boolean isToggle()
Returns
boolean

whether this action represents a toggle (i.e. has a checked and unchecked state).

setChecked

Added in 1.1.0-alpha02
abstract SliceAction setChecked(boolean isChecked)
Parameters
boolean isChecked

whether the state of this action is checked or not; only used for toggle actions.

setContentDescription

Added in 1.1.0-alpha02
abstract @Nullable SliceAction setContentDescription(@NonNull CharSequence description)
Parameters
@NonNull CharSequence description

the content description for this action.

setPriority

Added in 1.1.0-alpha02
abstract SliceAction setPriority(@IntRange(from = 0) int priority)

Sets the priority of this action, with the lowest priority having the highest ranking.