Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

PlaybackControlsRow

open class PlaybackControlsRow : Row
kotlin.Any
   ↳ androidx.leanback.widget.Row
   ↳ androidx.leanback.widget.PlaybackControlsRow

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 classes
open

Listener for progress or duration change.

abstract

Base class for an action comprised of a series of icons.

open

An action displaying icons for play and pause.

open

An action displaying an icon for fast forward.

open

An action displaying an icon for rewind.

open

An action displaying an icon for skip next.

open

An action displaying an icon for skip previous.

open

An action displaying an icon for picture-in-picture.

open

An action displaying an icon for "more actions".

abstract

A base class for displaying a thumbs action.

open

An action displaying an icon for thumbs up.

open

An action displaying an icon for thumbs down.

open

An action for displaying three repeat states: none, one, or all.

open

An action for displaying a shuffle icon.

open

An action for displaying a HQ (High Quality) icon.

open

An action for displaying a CC (Closed Captioning) icon.

Public constructors
<init>(item: Any!)

Constructor for a PlaybackControlsRow that displays some details from the given item.

Constructor for a PlaybackControlsRow that has no item details.

Public methods
open Int

Returns the buffered progress for the playback controls row.

open Long

Returns the buffered progress of long type for the playback controls row.

open Long

Returns duration in milliseconds.

Any!

Returns the main item for the details page.

open Long

Returns the current time in milliseconds of long type for playback controls row.

open Unit

Sets a listener to be called when the playback state changes.

Unit
setImageBitmap(context: Context!, bm: Bitmap!)

Sets a Bitmap for this row.

Drawable!

Returns the image Drawable of this row.

open Unit

Sets the current time in milliseconds for playback controls row in long type.

ObjectAdapter!

Returns the primary actions ObjectAdapter.

open Unit

Sets the buffered progress for the playback controls row.

open Unit

Sets the buffered progress for the playback controls row.

open Unit

Sets the total time in milliseconds (long type) for the playback controls row.

open Int

Returns the current time in milliseconds for the playback controls row.

open Action!

Returns the Action associated with the given keycode, or null if no associated action exists.

open Action!
getActionForKeyCode(adapter: ObjectAdapter!, keyCode: Int)

Returns the Action associated with the given keycode, or null if no associated action exists.

open Long

Returns the buffered progress of long type for the playback controls row.

open Unit

Sets the total time in milliseconds (long type) for the playback controls row.

open Unit

Sets the total time in milliseconds for the playback controls row.

Unit

Sets the secondary actions ObjectAdapter.

open Long

Returns the total time in milliseconds of long type for the playback controls row.

open Unit

Sets the buffered progress for the playback controls row.

Unit

Sets the primary actions ObjectAdapter.

Unit

Sets a {link @Drawable} image for this row.

ObjectAdapter!

Returns the secondary actions ObjectAdapter.

open Long

Returns the current time in milliseconds of long type for playback controls row.

open Int

Returns the total time in milliseconds for the playback controls row.

open Unit

Sets the current time in milliseconds for the playback controls row.

open Unit

Sets the current time in milliseconds for the playback controls row.

Inherited functions

Public constructors

<init>

PlaybackControlsRow(item: Any!)

Constructor for a PlaybackControlsRow that displays some details from the given item.

Parameters
item Any!: The main item for the row.

<init>

PlaybackControlsRow()

Constructor for a PlaybackControlsRow that has no item details.

Public methods

getBufferedProgress

open fun getBufferedProgress(): Int

Returns the buffered progress for the playback controls row.

Exceptions
ArithmeticException If buffered progress in milliseconds overflows int.

getBufferedProgressLong

open fun getBufferedProgressLong(): Long

Returns the buffered progress of long type for the playback controls row.

getDuration

open fun getDuration(): Long

Returns duration in milliseconds.

Return
Long: Duration in milliseconds.

getItem

fun getItem(): Any!

Returns the main item for the details page.

getCurrentPosition

open fun getCurrentPosition(): Long

Returns the current time in milliseconds of long type for playback controls row.

setOnPlaybackProgressChangedListener

open fun setOnPlaybackProgressChangedListener(listener: PlaybackControlsRow.OnPlaybackProgressCallback!): Unit

Sets a listener to be called when the playback state changes.

setImageBitmap

fun setImageBitmap(context: Context!, bm: Bitmap!): Unit

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.

Parameters
context Context!: The context to retrieve display metrics from.
bm Context!: The bitmap to set.

getImageDrawable

fun getImageDrawable(): Drawable!

Returns the image Drawable of this row.

Return
Drawable!: The overview's image drawable, or null if no drawable has been assigned.

setCurrentTimeLong

open fun setCurrentTimeLong(ms: Long): Unit

Sets the current time in milliseconds for playback controls row in long type.

Parameters
ms Long: Current time in milliseconds of long type.

getPrimaryActionsAdapter

fun getPrimaryActionsAdapter(): ObjectAdapter!

Returns the primary actions ObjectAdapter.

setBufferedProgress

open fun setBufferedProgress(ms: Int): Unit

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.

setBufferedPosition

open fun setBufferedPosition(ms: Long): Unit

Sets the buffered progress for the playback controls row.

Parameters
ms Long: Buffered progress in milliseconds of long type.

setDuration

open fun setDuration(ms: Long): Unit

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
ms Long: Total time in milliseconds of long type.

getCurrentTime

open fun getCurrentTime(): Int

Returns the current time in milliseconds for the playback controls row.

Exceptions
ArithmeticException If current time in milliseconds overflows int.

getActionForKeyCode

open fun getActionForKeyCode(keyCode: Int): Action!

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

open fun getActionForKeyCode(adapter: ObjectAdapter!, keyCode: Int): Action!

Returns the Action associated with the given keycode, or null if no associated action exists.

getBufferedPosition

open fun getBufferedPosition(): Long

Returns the buffered progress of long type for the playback controls row.

setTotalTimeLong

open fun setTotalTimeLong(ms: Long): Unit

Sets the total time in milliseconds (long type) for the playback controls row.

Parameters
ms Long: Total time in milliseconds of long type.

setTotalTime

open fun setTotalTime(ms: Int): Unit

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.

setSecondaryActionsAdapter

fun setSecondaryActionsAdapter(adapter: ObjectAdapter!): Unit

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.

getTotalTimeLong

open fun getTotalTimeLong(): Long

Returns the total time in milliseconds of long type for the playback controls row.

setBufferedProgressLong

open fun setBufferedProgressLong(ms: Long): Unit

Sets the buffered progress for the playback controls row.

Parameters
ms Long: Buffered progress in milliseconds of long type.

setPrimaryActionsAdapter

fun setPrimaryActionsAdapter(adapter: ObjectAdapter!): Unit

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.

setImageDrawable

fun setImageDrawable(drawable: Drawable!): Unit

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.

getSecondaryActionsAdapter

fun getSecondaryActionsAdapter(): ObjectAdapter!

Returns the secondary actions ObjectAdapter.

getCurrentTimeLong

open fun getCurrentTimeLong(): Long

Returns the current time in milliseconds of long type for playback controls row.

getTotalTime

open fun getTotalTime(): Int

Returns the total time in milliseconds for the playback controls row.

Exceptions
ArithmeticException If total time in milliseconds overflows int.

setCurrentTime

open fun setCurrentTime(ms: Int): Unit

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.

setCurrentPosition

open fun setCurrentPosition(ms: Long): Unit

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
ms Long: Current time in milliseconds of long type.