SliceAction
@RequiresApi(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 methods
getContentDescription
@Nullable abstract fun getContentDescription(): CharSequence?
Return |
CharSequence? |
the content description to use for this action. |
getIcon
@Nullable 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. |
getImageMode
abstract fun getImageMode(): Int
Return |
Int |
the image mode to use for this action. |
getPriority
abstract fun getPriority(): Int
Return |
Int |
the priority associated with this action, -1 if unset. |
isActivity
abstract fun isActivity(): Boolean
Return |
Boolean |
whether this activity launches an activity or not. |
isChecked
abstract fun isChecked(): Boolean
Return |
Boolean |
whether the state of this action is checked or not; only used for toggle actions. |
isDefaultToggle
abstract fun isDefaultToggle(): Boolean
Return |
Boolean |
whether this action is a toggle using the standard switch control. |
isToggle
abstract fun isToggle(): Boolean
Return |
Boolean |
whether this action represents a toggle (i.e. has a checked and unchecked state). |
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. |
setContentDescription
@Nullable abstract fun setContentDescription(@NonNull description: CharSequence): SliceAction?
Parameters |
description |
CharSequence: the content description for this action. |
setPriority
abstract fun setPriority(@IntRange(0) priority: Int): SliceAction!
Sets the priority of this action, with the lowest priority having the highest ranking.