PlaybackControlsRow


class PlaybackControlsRow : 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

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

An action displaying an icon for fast forward.

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

An action displaying an icon for "more actions".

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

Listener for progress or duration change.

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

An action displaying icons for play and pause.

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

An action displaying an icon for rewind.

An action for displaying a shuffle icon.

An action displaying an icon for skip next.

An action displaying an icon for skip previous.

A base class for displaying a thumbs action.

An action displaying an icon for thumbs down.

An action displaying an icon for thumbs up.

Public constructors

Constructor for a PlaybackControlsRow that has no item details.

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

Public functions

Action!

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

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

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 function is deprecated.

Use getBufferedPosition

Long

This function is deprecated.

Use getBufferedPosition

Long

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

Int

This function is deprecated.

Use getCurrentPosition

Long

This function is deprecated.

Use getCurrentPosition

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.

Int

This function is deprecated.

use getDuration

Long

This function is deprecated.

use getDuration

Unit

Sets the buffered progress for the playback controls row.

Unit

This function is deprecated.

Use setBufferedPosition

Unit

This function is deprecated.

Use setBufferedPosition

Unit

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

Unit

This function is deprecated.

use setCurrentPosition

Unit

This function is deprecated.

use setCurrentPosition

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.

Unit

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

Unit

Sets the primary actions ObjectAdapter.

Unit

Sets the secondary actions ObjectAdapter.

Unit

This function is deprecated.

Use setDuration

Unit

This function is deprecated.

Use setDuration

Inherited functions

From androidx.leanback.widget.Row
HeaderItem!

Returns the HeaderItem that represents metadata for the row.

Long

Returns a unique identifier for this row.

Boolean

Returns true if this Row can be rendered in a visible row view, false otherwise.

Unit
setHeaderItem(headerItem: HeaderItem!)

Sets the HeaderItem that represents metadata for the row.

Unit
setId(id: Long)

Sets the id for this row.

Public constructors

PlaybackControlsRow

Added in 1.1.0
PlaybackControlsRow()

Constructor for a PlaybackControlsRow that has no item details.

PlaybackControlsRow

Added in 1.1.0
PlaybackControlsRow(item: Any!)

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

Parameters
item: Any!

The main item for the row.

Public functions

getActionForKeyCode

Added in 1.1.0
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

Added in 1.1.0
fun getActionForKeyCode(adapter: ObjectAdapter!, keyCode: Int): Action!

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

getBufferedPosition

Added in 1.1.0
fun getBufferedPosition(): Long

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

getBufferedProgress

Added in 1.1.0
Deprecated in 1.1.0
fun getBufferedProgress(): Int

Returns the buffered progress for the playback controls row.

Throws
java.lang.ArithmeticException

If buffered progress in milliseconds overflows int.

getBufferedProgressLong

Added in 1.1.0
Deprecated in 1.1.0
fun getBufferedProgressLong(): Long

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

getCurrentPosition

Added in 1.1.0
fun getCurrentPosition(): Long

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

getCurrentTime

Added in 1.1.0
Deprecated in 1.1.0
fun getCurrentTime(): Int

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

Throws
java.lang.ArithmeticException

If current time in milliseconds overflows int.

getCurrentTimeLong

Added in 1.1.0
Deprecated in 1.1.0
fun getCurrentTimeLong(): Long

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

getDuration

Added in 1.1.0
fun getDuration(): Long

Returns duration in milliseconds.

Returns
Long

Duration in milliseconds.

getImageDrawable

Added in 1.1.0
fun getImageDrawable(): Drawable!

Returns the image Drawable of this row.

Returns
Drawable!

The overview's image drawable, or null if no drawable has been assigned.

getItem

Added in 1.1.0
fun getItem(): Any!

Returns the main item for the details page.

getPrimaryActionsAdapter

Added in 1.1.0
fun getPrimaryActionsAdapter(): ObjectAdapter!

Returns the primary actions ObjectAdapter.

getSecondaryActionsAdapter

Added in 1.1.0
fun getSecondaryActionsAdapter(): ObjectAdapter!

Returns the secondary actions ObjectAdapter.

getTotalTime

Added in 1.1.0
Deprecated in 1.1.0
fun getTotalTime(): Int

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

Throws
java.lang.ArithmeticException

If total time in milliseconds overflows int.

getTotalTimeLong

Added in 1.1.0
Deprecated in 1.1.0
fun getTotalTimeLong(): Long

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

setBufferedPosition

Added in 1.1.0
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

Added in 1.1.0
Deprecated in 1.1.0
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.

setBufferedProgressLong

Added in 1.1.0
Deprecated in 1.1.0
fun setBufferedProgressLong(ms: Long): Unit

Sets the buffered progress for the playback controls row.

Parameters
ms: Long

Buffered progress in milliseconds of long type.

setCurrentPosition

Added in 1.1.0
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

Added in 1.1.0
Deprecated in 1.1.0
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.

setCurrentTimeLong

Added in 1.1.0
Deprecated in 1.1.0
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.

setDuration

Added in 1.1.0
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

Added in 1.1.0
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: Bitmap!

The bitmap to set.

setImageDrawable

Added in 1.1.0
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

Added in 1.1.0
fun setOnPlaybackProgressChangedListener(
    listener: PlaybackControlsRow.OnPlaybackProgressCallback!
): Unit

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

setPrimaryActionsAdapter

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
Deprecated in 1.1.0
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.

setTotalTimeLong

Added in 1.1.0
Deprecated in 1.1.0
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.