PlaybackControlsRow
public class PlaybackControlsRow extends Row
A Row of playback controls to be displayed by a PlaybackControlsRowPresenter. This row consists of some optional item detail, a series of primary actions, and an optional series of secondary actions.
Controls are specified via an ObjectAdapter containing one or more Actions.
Adapters should have their PresenterSelector set to an instance of ControlButtonPresenterSelector.
Summary
Nested types |
|---|
public class PlaybackControlsRow.ClosedCaptioningAction extends PlaybackControlsRow.MultiActionAn action for displaying a CC (Closed Captioning) icon. |
public class PlaybackControlsRow.FastForwardAction extends PlaybackControlsRow.MultiActionAn action displaying an icon for fast forward. |
public class PlaybackControlsRow.HighQualityAction extends PlaybackControlsRow.MultiActionAn action for displaying a HQ (High Quality) icon. |
public class PlaybackControlsRow.MoreActions extends ActionAn action displaying an icon for "more actions". |
public abstract class PlaybackControlsRow.MultiAction extends ActionBase class for an action comprised of a series of icons. |
public class PlaybackControlsRow.OnPlaybackProgressCallbackListener for progress or duration change. |
public class PlaybackControlsRow.PictureInPictureAction extends ActionAn action displaying an icon for picture-in-picture. |
public class PlaybackControlsRow.PlayPauseAction extends PlaybackControlsRow.MultiActionAn action displaying icons for play and pause. |
public class PlaybackControlsRow.RepeatAction extends PlaybackControlsRow.MultiActionAn action for displaying three repeat states: none, one, or all. |
public class PlaybackControlsRow.RewindAction extends PlaybackControlsRow.MultiActionAn action displaying an icon for rewind. |
public class PlaybackControlsRow.ShuffleAction extends PlaybackControlsRow.MultiActionAn action for displaying a shuffle icon. |
public class PlaybackControlsRow.SkipNextAction extends ActionAn action displaying an icon for skip next. |
public class PlaybackControlsRow.SkipPreviousAction extends ActionAn action displaying an icon for skip previous. |
public abstract class PlaybackControlsRow.ThumbsAction extends PlaybackControlsRow.MultiActionA base class for displaying a thumbs action. |
public class PlaybackControlsRow.ThumbsDownAction extends PlaybackControlsRow.ThumbsActionAn action displaying an icon for thumbs down. |
public class PlaybackControlsRow.ThumbsUpAction extends PlaybackControlsRow.ThumbsActionAn action displaying an icon for thumbs up. |
Public constructors |
|---|
|
Constructor for a PlaybackControlsRow that has no item details. |
PlaybackControlsRow(Object item)Constructor for a PlaybackControlsRow that displays some details from the given item. |
Public methods |
|
|---|---|
Action |
getActionForKeyCode(int keyCode)Returns the Action associated with the given keycode, or null if no associated action exists. |
Action |
getActionForKeyCode(ObjectAdapter adapter, int keyCode)Returns the Action associated with the given keycode, or null if no associated action exists. |
long |
Returns the buffered progress of long type for the playback controls row. |
int |
This method is deprecated. |
long |
This method is deprecated. |
long |
Returns the current time in milliseconds of long type for playback controls row. |
int |
This method is deprecated. |
long |
This method is deprecated. |
long |
Returns duration in milliseconds. |
final Drawable |
Returns the image |
final Object |
getItem()Returns the main item for the details page. |
final ObjectAdapter |
Returns the primary actions |
final ObjectAdapter |
Returns the secondary actions |
int |
This method is deprecated. use |
long |
This method is deprecated. use |
void |
setBufferedPosition(long ms)Sets the buffered progress for the playback controls row. |
void |
This method is deprecated. |
void |
This method is deprecated. |
void |
setCurrentPosition(long ms)Sets the current time in milliseconds for the playback controls row. |
void |
This method is deprecated. |
void |
This method is deprecated. |
void |
setDuration(long ms)Sets the total time in milliseconds (long type) for the playback controls row. |
final void |
setImageBitmap(Context context, Bitmap bm)Sets a |
final void |
setImageDrawable(Drawable drawable)Sets a {link @Drawable} image for this row. |
void |
Sets a listener to be called when the playback state changes. |
final void |
setPrimaryActionsAdapter(ObjectAdapter adapter)Sets the primary actions |
final void |
setSecondaryActionsAdapter(ObjectAdapter adapter)Sets the secondary actions |
void |
This method is deprecated. Use |
void |
This method is deprecated. Use |
Inherited methods |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
PlaybackControlsRow
public PlaybackControlsRow()
Constructor for a PlaybackControlsRow that has no item details.
PlaybackControlsRow
public PlaybackControlsRow(Object item)
Constructor for a PlaybackControlsRow that displays some details from the given item.
| Parameters | |
|---|---|
Object item |
The main item for the row. |
Public methods
getActionForKeyCode
public Action getActionForKeyCode(int keyCode)
Returns the Action associated with the given keycode, or null if no associated action exists. Searches the primary adapter first, then the secondary adapter.
getActionForKeyCode
public Action getActionForKeyCode(ObjectAdapter adapter, int keyCode)
Returns the Action associated with the given keycode, or null if no associated action exists.
getBufferedPosition
public long getBufferedPosition()
Returns the buffered progress of long type for the playback controls row.
public int getBufferedProgress()Returns the buffered progress for the playback controls row.
| Throws | |
|---|---|
java.lang.ArithmeticException |
If buffered progress in milliseconds overflows int. |
public long getBufferedProgressLong()Returns the buffered progress of long type for the playback controls row.
getCurrentPosition
public long getCurrentPosition()
Returns the current time in milliseconds of long type for playback controls row.
public int getCurrentTime()Returns the current time in milliseconds for the playback controls row.
| Throws | |
|---|---|
java.lang.ArithmeticException |
If current time in milliseconds overflows int. |
public long getCurrentTimeLong()Returns the current time in milliseconds of long type for playback controls row.
getDuration
public long getDuration()
Returns duration in milliseconds.
| Returns | |
|---|---|
long |
Duration in milliseconds. |
getImageDrawable
public final Drawable getImageDrawable()
Returns the image Drawable of this row.
| Returns | |
|---|---|
Drawable |
The overview's image drawable, or null if no drawable has been assigned. |
getPrimaryActionsAdapter
public final ObjectAdapter getPrimaryActionsAdapter()
Returns the primary actions ObjectAdapter.
getSecondaryActionsAdapter
public final ObjectAdapter getSecondaryActionsAdapter()
Returns the secondary actions ObjectAdapter.
public int getTotalTime()Returns the total time in milliseconds for the playback controls row.
| Throws | |
|---|---|
java.lang.ArithmeticException |
If total time in milliseconds overflows int. |
public long getTotalTimeLong()Returns the total time in milliseconds of long type for the playback controls row.
setBufferedPosition
public void setBufferedPosition(long ms)
Sets the buffered progress for the playback controls row.
| Parameters | |
|---|---|
long ms |
Buffered progress in milliseconds of long type. |
public void setBufferedProgress(int ms)Sets the buffered progress for the playback controls row. If this row is bound to a view, the view will automatically be updated to reflect the new value.
public void setBufferedProgressLong(long ms)Sets the buffered progress for the playback controls row.
| Parameters | |
|---|---|
long ms |
Buffered progress in milliseconds of long type. |
setCurrentPosition
public void setCurrentPosition(long ms)
Sets the current time in milliseconds for the playback controls row. If this row is bound to a view, the view will automatically be updated to reflect the new value.
| Parameters | |
|---|---|
long ms |
Current time in milliseconds of long type. |
public void setCurrentTime(int ms)Sets the current time in milliseconds for the playback controls row. If this row is bound to a view, the view will automatically be updated to reflect the new value.
public void setCurrentTimeLong(long ms)Sets the current time in milliseconds for playback controls row in long type.
| Parameters | |
|---|---|
long ms |
Current time in milliseconds of long type. |
setDuration
public void setDuration(long ms)
Sets the total time in milliseconds (long type) for the playback controls row. If this row is bound to a view, the view will automatically be updated to reflect the new value.
| Parameters | |
|---|---|
long ms |
Total time in milliseconds of long type. |
setImageBitmap
public final void setImageBitmap(Context context, Bitmap bm)
Sets a Bitmap for this row.
If set after the row has been bound to a view, the adapter must be notified that this row has changed.
setImageDrawable
public final void setImageDrawable(Drawable drawable)
Sets a {link @Drawable} image for this row.
If set after the row has been bound to a view, the adapter must be notified that this row has changed.
| Parameters | |
|---|---|
Drawable drawable |
The drawable to set. |
setOnPlaybackProgressChangedListener
public void setOnPlaybackProgressChangedListener(
PlaybackControlsRow.OnPlaybackProgressCallback listener
)
Sets a listener to be called when the playback state changes.
setPrimaryActionsAdapter
public final void setPrimaryActionsAdapter(ObjectAdapter adapter)
Sets the primary actions ObjectAdapter.
If set after the row has been bound to a view, the adapter must be notified that this row has changed.
setSecondaryActionsAdapter
public final void setSecondaryActionsAdapter(ObjectAdapter adapter)
Sets the secondary actions ObjectAdapter.
If set after the row has been bound to a view, the adapter must be notified that this row has changed.
public void setTotalTime(int ms)Sets the total time in milliseconds for the playback controls row.
If set after the row has been bound to a view, the adapter must be notified that this row has changed.
public void setTotalTimeLong(long ms)Sets the total time in milliseconds (long type) for the playback controls row.
| Parameters | |
|---|---|
long ms |
Total time in milliseconds of long type. |