ViewHolder

open class ViewHolder : PlaybackRowPresenter.ViewHolder, PlaybackSeekUi
kotlin.Any
   ↳ androidx.leanback.widget.Presenter.ViewHolder
   ↳ androidx.leanback.widget.RowPresenter.ViewHolder
   ↳ androidx.leanback.widget.PlaybackRowPresenter.ViewHolder
   ↳ androidx.leanback.widget.PlaybackTransportRowPresenter.ViewHolder

A ViewHolder for the PlaybackControlsRow supporting seek UI.

Summary

Public constructors
<init>(rootView: View!, descriptionPresenter: Presenter!)

Constructor of ViewHolder of PlaybackTransportRowPresenter

Public methods
TextView!

Returns the TextView that showing current position label.

Presenter.ViewHolder!

TextView!

Returns the TextView that showing total time label.

open Unit

Protected methods
open Unit

Called to update current time label.

open Unit
onSetDurationLabel(totalTimeMs: Long)

Called to update total time label.

Public constructors

<init>

ViewHolder(rootView: View!, descriptionPresenter: Presenter!)

Constructor of ViewHolder of PlaybackTransportRowPresenter

Parameters
rootView View!: Root view of the ViewHolder.
descriptionPresenter View!: The presenter that will be used to create description ViewHolder. The description view will be added into tree.

Public methods

getCurrentPositionView

fun getCurrentPositionView(): TextView!

Returns the TextView that showing current position label. This method might be used in onSetCurrentPositionLabel.

Return
TextView!: The TextView that showing current position label.

getDescriptionViewHolder

fun getDescriptionViewHolder(): Presenter.ViewHolder!
Return
Presenter.ViewHolder!: The ViewHolder for description.

getDurationView

fun getDurationView(): TextView!

Returns the TextView that showing total time label. This method might be used in onSetDurationLabel.

Return
TextView!: The TextView that showing total time label.

setPlaybackSeekUiClient

open fun setPlaybackSeekUiClient(client: PlaybackSeekUi.Client!): Unit

Protected methods

onSetCurrentPositionLabel

protected open fun onSetCurrentPositionLabel(currentTimeMs: Long): Unit

Called to update current time label. Default implementation updates the TextView getCurrentPositionView. Subclass might override.

Parameters
currentTimeMs Long: Current playback position in milliseconds.

onSetDurationLabel

protected open fun onSetDurationLabel(totalTimeMs: Long): Unit

Called to update total time label. Default implementation updates the TextView getDurationView(). Subclass might override.

Parameters
totalTimeMs Long: Total duration of the media in milliseconds.