SliceAction

interface SliceAction
androidx.slice.core.SliceAction

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

Summary

Public methods
abstract IconCompat?

abstract SliceAction?

abstract CharSequence?

abstract Boolean

abstract Boolean

abstract Boolean

abstract Int

abstract SliceAction!
setChecked(isChecked: Boolean)

abstract PendingIntent

abstract CharSequence

abstract Int

abstract SliceAction!
setPriority(priority: Int)

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

Public methods

getIcon

abstract fun getIcon(): IconCompat?
Return
IconCompat?: the IconCompat to display for this action. This can be null when the action represented is a default toggle.

setContentDescription

abstract fun setContentDescription(description: CharSequence): SliceAction?
Parameters
description CharSequence: the content description for this action.

getContentDescription

abstract fun getContentDescription(): CharSequence?
Return
CharSequence?: the content description to use for this action.

isToggle

abstract fun isToggle(): Boolean
Return
Boolean: whether this action represents a toggle (i.e. has a checked and unchecked state).

isDefaultToggle

abstract fun isDefaultToggle(): Boolean
Return
Boolean: whether this action is a toggle using the standard switch control.

isChecked

abstract fun isChecked(): Boolean
Return
Boolean: whether the state of this action is checked or not; only used for toggle actions.

getPriority

abstract fun getPriority(): Int
Return
Int: the priority associated with this action, -1 if unset.

setChecked

abstract fun setChecked(isChecked: Boolean): SliceAction!
Parameters
isChecked Boolean: whether the state of this action is checked or not; only used for toggle actions.

getAction

abstract fun getAction(): PendingIntent
Return
PendingIntent: the PendingIntent associated with this action.

getTitle

abstract fun getTitle(): CharSequence
Return
CharSequence: the title for this action.

getImageMode

abstract fun getImageMode(): Int
Return
Int: the image mode to use for this action.

setPriority

abstract fun setPriority(priority: Int): SliceAction!

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