Action
public class Action
GuidedAction |
A data class which represents an action within a . |
PlaybackControlsRow.MoreActions |
An action displaying an icon for "more actions". |
PlaybackControlsRow.MultiAction |
Base class for an action comprised of a series of icons. |
PlaybackControlsRow.PictureInPictureAction |
An action displaying an icon for picture-in-picture. |
PlaybackControlsRow.SkipNextAction |
An action displaying an icon for skip next. |
PlaybackControlsRow.SkipPreviousAction |
An action displaying an icon for skip previous. |
GuidedDatePickerAction |
Subclass of GuidedAction that can choose a date. |
PlaybackControlsRow.ClosedCaptioningAction |
An action for displaying a CC (Closed Captioning) icon. |
PlaybackControlsRow.FastForwardAction |
An action displaying an icon for fast forward. |
PlaybackControlsRow.HighQualityAction |
An action for displaying a HQ (High Quality) icon. |
PlaybackControlsRow.PlayPauseAction |
An action displaying icons for play and pause. |
PlaybackControlsRow.RepeatAction |
An action for displaying three repeat states: none, one, or all. |
PlaybackControlsRow.RewindAction |
An action displaying an icon for rewind. |
PlaybackControlsRow.ShuffleAction |
An action for displaying a shuffle icon. |
PlaybackControlsRow.ThumbsAction |
A base class for displaying a thumbs action. |
PlaybackControlsRow.ThumbsDownAction |
An action displaying an icon for thumbs down. |
PlaybackControlsRow.ThumbsUpAction |
An action displaying an icon for thumbs up. |
An action contains one or two lines of text, an optional image and an optional id. It may also be invoked by one or more keycodes.
Summary
Constants |
|
---|---|
static final long |
NO_ID = -1 Indicates that an id has not been set. |
Public constructors |
---|
Action(long id) Constructor for an Action. |
Action(long id, @Nullable CharSequence label) Constructor for an Action. |
Action( Constructor for an Action. |
Action( Constructor for an Action. |
Public methods |
|
---|---|
final void |
addKeyCode(int keyCode) Adds a keycode used to invoke this Action. |
final @Nullable Drawable |
getIcon() Returns the icon drawable for this Action. |
final long |
getId() Returns the id for this Action. |
final @Nullable CharSequence |
Returns the first line label for this Action. |
final @Nullable CharSequence |
Returns the second line label for this Action. |
final void |
removeKeyCode(int keyCode) Removes a keycode used to invoke this Action. |
final boolean |
respondsToKeyCode(int keyCode) Returns true if the Action should respond to the given keycode. |
final void |
Sets the icon drawable for this Action. |
final void |
setId(long id) Sets the id for this Action. |
final void |
setLabel1(@Nullable CharSequence label) Sets the first line label for this Action. |
final void |
setLabel2(@Nullable CharSequence label) Sets the second line label for this Action. |
@NonNull String |
toString() |
Constants
Public constructors
Action
public Action(long id)
Constructor for an Action.
Parameters | |
---|---|
long id |
The id of the Action. |
Action
public Action(long id, @Nullable CharSequence label)
Constructor for an Action.
Parameters | |
---|---|
long id |
The id of the Action. |
@Nullable CharSequence label |
The label to display for the Action. |
Action
public Action(
long id,
@Nullable CharSequence label1,
@Nullable CharSequence label2
)
Constructor for an Action.
Parameters | |
---|---|
long id |
The id of the Action. |
@Nullable CharSequence label1 |
The label to display on the first line of the Action. |
@Nullable CharSequence label2 |
The label to display on the second line of the Action. |
Action
public Action(
long id,
@Nullable CharSequence label1,
@Nullable CharSequence label2,
@Nullable Drawable icon
)
Constructor for an Action.
Parameters | |
---|---|
long id |
The id of the Action. |
@Nullable CharSequence label1 |
The label to display on the first line of the Action. |
@Nullable CharSequence label2 |
The label to display on the second line of the Action. |
@Nullable Drawable icon |
The icon to display for the Action. |
Public methods
addKeyCode
public final void addKeyCode(int keyCode)
Adds a keycode used to invoke this Action.
getIcon
public final @Nullable Drawable getIcon()
Returns the icon drawable for this Action.
getLabel1
public final @Nullable CharSequence getLabel1()
Returns the first line label for this Action.
getLabel2
public final @Nullable CharSequence getLabel2()
Returns the second line label for this Action.
removeKeyCode
public final void removeKeyCode(int keyCode)
Removes a keycode used to invoke this Action.
respondsToKeyCode
public final boolean respondsToKeyCode(int keyCode)
Returns true if the Action should respond to the given keycode.
setIcon
public final void setIcon(@Nullable Drawable icon)
Sets the icon drawable for this Action.
setLabel1
public final void setLabel1(@Nullable CharSequence label)
Sets the first line label for this Action.
setLabel2
public final void setLabel2(@Nullable CharSequence label)
Sets the second line label for this Action.