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