SliceAction


@RequiresApi(value = 19)
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 functions

PendingIntent
CharSequence?
IconCompat?
Int
Int
CharSequence
Boolean
Boolean
Boolean
Boolean
SliceAction!
setChecked(isChecked: Boolean)
SliceAction?
SliceAction!
setPriority(priority: @IntRange(from = 0) Int)

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

Public functions

getAction

Added in 1.1.0-alpha02
fun getAction(): PendingIntent
Returns
PendingIntent

the PendingIntent associated with this action.

getContentDescription

Added in 1.1.0-alpha02
fun getContentDescription(): CharSequence?
Returns
CharSequence?

the content description to use for this action.

getIcon

Added in 1.1.0-alpha02
fun getIcon(): IconCompat?
Returns
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
fun getImageMode(): Int
Returns
Int

the image mode to use for this action.

getPriority

Added in 1.1.0-alpha02
fun getPriority(): Int
Returns
Int

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

getTitle

Added in 1.1.0-alpha02
fun getTitle(): CharSequence
Returns
CharSequence

the title for this action.

isActivity

Added in 1.1.0-alpha02
fun isActivity(): Boolean
Returns
Boolean

whether this activity launches an activity or not.

isChecked

Added in 1.1.0-alpha02
fun isChecked(): Boolean
Returns
Boolean

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

isDefaultToggle

Added in 1.1.0-alpha02
fun isDefaultToggle(): Boolean
Returns
Boolean

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

isToggle

Added in 1.1.0-alpha02
fun isToggle(): Boolean
Returns
Boolean

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

setChecked

Added in 1.1.0-alpha02
fun setChecked(isChecked: Boolean): SliceAction!
Parameters
isChecked: Boolean

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

setContentDescription

Added in 1.1.0-alpha02
fun setContentDescription(description: CharSequence): SliceAction?
Parameters
description: CharSequence

the content description for this action.

setPriority

Added in 1.1.0-alpha02
fun setPriority(priority: @IntRange(from = 0) Int): SliceAction!

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