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

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

open

An action displaying an icon for fast forward.

open

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

open

An action displaying an icon for "more actions".

abstract

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

open

Listener for progress or duration change.

open

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

open

An action displaying icons for play and pause.

open

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

open

An action displaying an icon for rewind.

open

An action for displaying a shuffle icon.

open

An action displaying an icon for skip next.

open

An action displaying an icon for skip previous.

abstract

A base class for displaying a thumbs action.

open

An action displaying an icon for thumbs down.

open

An action displaying an icon for thumbs up.

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 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 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 the current time in milliseconds of long type for playback controls row.

open Int

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

open Long

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

open Long

Returns duration in milliseconds.

Drawable!

Returns the image Drawable of this row.

Any!

Returns the main item for the details page.

ObjectAdapter!

Returns the primary actions ObjectAdapter.

ObjectAdapter!

Returns the secondary actions ObjectAdapter.

open Int

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

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.

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 current 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 playback controls row in long type.

open Unit

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

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

Sets a Bitmap for this row.

Unit

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

open Unit

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

Unit

Sets the primary actions ObjectAdapter.

Unit

Sets the secondary actions ObjectAdapter.

open Unit

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

open Unit

Sets the total time in milliseconds (long type) 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

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.

getBufferedProgress

open fun getBufferedProgress(): Int

Deprecated: Use getBufferedPosition()

Returns the buffered progress for the playback controls row.

Exceptions
ArithmeticException If buffered progress in milliseconds overflows int.

getBufferedProgressLong

open fun getBufferedProgressLong(): Long

Deprecated: Use getBufferedPosition()

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

getCurrentPosition

open fun getCurrentPosition(): Long

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

getCurrentTime

open fun getCurrentTime(): Int

Deprecated: Use getCurrentPosition()

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

Exceptions
ArithmeticException If current time in milliseconds overflows int.

getCurrentTimeLong

open fun getCurrentTimeLong(): Long

Deprecated: Use getCurrentPosition()

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

getDuration

open fun getDuration(): Long

Returns duration in milliseconds.

Return
Long: Duration in milliseconds.

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.

getItem

fun getItem(): Any!

Returns the main item for the details page.

getPrimaryActionsAdapter

fun getPrimaryActionsAdapter(): ObjectAdapter!

Returns the primary actions ObjectAdapter.

getSecondaryActionsAdapter

fun getSecondaryActionsAdapter(): ObjectAdapter!

Returns the secondary actions ObjectAdapter.

getTotalTime

open fun getTotalTime(): Int

Deprecated: use getDuration()

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

Exceptions
ArithmeticException If total time in milliseconds overflows int.

getTotalTimeLong

open fun getTotalTimeLong(): Long

Deprecated: use getDuration()

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

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.

setBufferedProgress

open fun setBufferedProgress(ms: Int): Unit

Deprecated: Use setBufferedPosition(long)

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.

setBufferedProgressLong

open fun setBufferedProgressLong(ms: Long): Unit

Deprecated: Use setBufferedPosition(long)

Sets the buffered progress for the playback controls row.

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

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.

setCurrentTime

open fun setCurrentTime(ms: Int): Unit

Deprecated: use setCurrentPosition(long)

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.

setCurrentTimeLong

open fun setCurrentTimeLong(ms: Long): Unit

Deprecated: use setCurrentPosition(long)

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

Parameters
ms Long: Current time 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.

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.

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.

setOnPlaybackProgressChangedListener

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

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

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.

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.

setTotalTime

open fun setTotalTime(ms: Int): Unit

Deprecated: Use setDuration(long)

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.

setTotalTimeLong

open fun setTotalTimeLong(ms: Long): Unit

Deprecated: Use setDuration(long)

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

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