SliceAction
@RequiresApi(19) open class SliceAction : SliceAction
kotlin.Any | |
↳ | androidx.slice.builders.SliceAction |
Class representing an action, supports tappable icons, custom toggle icons, and default toggles, as well as date and time pickers.
Summary
Public methods | |
---|---|
open static SliceAction! |
create(@NonNull action: PendingIntent, @NonNull actionIcon: IconCompat, imageMode: Int, @NonNull actionTitle: CharSequence) Construct a SliceAction representing a tappable icon. |
open static SliceAction! |
create(@NonNull action: RemoteCallback, @NonNull actionIcon: IconCompat, imageMode: Int, @NonNull actionTitle: CharSequence) Construct a SliceAction representing a tappable icon. |
open static SliceAction! |
createDeeplink(@NonNull action: PendingIntent, @NonNull actionIcon: IconCompat, imageMode: Int, @NonNull actionTitle: CharSequence) Construct a SliceAction representing a tappable icon that launches an activity when clicked. |
open static SliceAction! |
createDeeplink(@NonNull action: RemoteCallback, @NonNull actionIcon: IconCompat, imageMode: Int, @NonNull actionTitle: CharSequence) Construct a SliceAction representing a tappable icon that launches an activity when clicked. |
open static SliceAction! |
createToggle(@NonNull action: PendingIntent, @NonNull actionTitle: CharSequence, isChecked: Boolean) Construct a SliceAction representing a default toggle. |
open static SliceAction! |
createToggle(@NonNull action: RemoteCallback, @NonNull actionTitle: CharSequence, isChecked: Boolean) Construct a SliceAction representing a default toggle. |
open static SliceAction! |
createToggle(@NonNull action: PendingIntent, @NonNull actionIcon: IconCompat, @NonNull actionTitle: CharSequence, isChecked: Boolean) Construct a SliceAction representing a custom toggle icon. |
open static SliceAction! |
createToggle(@NonNull action: RemoteCallback, @NonNull actionIcon: IconCompat, @NonNull actionTitle: CharSequence, isChecked: Boolean) Construct a SliceAction representing a custom toggle icon. |
open PendingIntent | |
open CharSequence? | |
open IconCompat? |
getIcon() |
open Int | |
open Int | |
open CharSequence |
getTitle() |
open Boolean | |
open Boolean | |
open Boolean | |
open Boolean |
isToggle() |
open SliceAction |
setChecked(isChecked: Boolean) |
open SliceAction |
setContentDescription(@NonNull description: CharSequence) |
open SliceAction |
setPriority(@IntRange(0) priority: Int) Sets the priority of this action, with the lowest priority having the highest ranking. |
Public methods
create
open static fun create(
@NonNull action: PendingIntent,
@NonNull actionIcon: IconCompat,
imageMode: Int,
@NonNull actionTitle: CharSequence
): SliceAction!
Construct a SliceAction representing a tappable icon.
Parameters | |
---|---|
action |
PendingIntent: the pending intent to invoke for this action. |
actionIcon |
IconCompat: the icon to display for this action. |
imageMode |
Int: the mode this icon should be displayed in. |
actionTitle |
CharSequence: the title for this action, also used for content description if one hasn't been set via setContentDescription(CharSequence) . |
create
open static fun create(
@NonNull action: RemoteCallback,
@NonNull actionIcon: IconCompat,
imageMode: Int,
@NonNull actionTitle: CharSequence
): SliceAction!
Construct a SliceAction representing a tappable icon.
Parameters | |
---|---|
action |
RemoteCallback: the remote callback to invoke for this action. |
actionIcon |
IconCompat: the icon to display for this action. |
imageMode |
Int: the mode this icon should be displayed in. |
actionTitle |
CharSequence: the title for this action, also used for content description if one hasn't been set via setContentDescription(CharSequence) . |
createDeeplink
open static fun createDeeplink(
@NonNull action: PendingIntent,
@NonNull actionIcon: IconCompat,
imageMode: Int,
@NonNull actionTitle: CharSequence
): SliceAction!
Construct a SliceAction representing a tappable icon that launches an activity when clicked.
Parameters | |
---|---|
action |
PendingIntent: the pending intent to invoke for this action. |
actionIcon |
IconCompat: the icon to display for this action. |
imageMode |
Int: the mode this icon should be displayed in. |
actionTitle |
CharSequence: the title for this action, also used for content description if one hasn't been set via setContentDescription(CharSequence) . |
createDeeplink
open static fun createDeeplink(
@NonNull action: RemoteCallback,
@NonNull actionIcon: IconCompat,
imageMode: Int,
@NonNull actionTitle: CharSequence
): SliceAction!
Construct a SliceAction representing a tappable icon that launches an activity when clicked.
Parameters | |
---|---|
action |
RemoteCallback: the remote callback to invoke for this action. |
actionIcon |
IconCompat: the icon to display for this action. |
imageMode |
Int: the mode this icon should be displayed in. |
actionTitle |
CharSequence: the title for this action, also used for content description if one hasn't been set via setContentDescription(CharSequence) . |
See Also