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