Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

PlaybackTransportRowPresenter

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

A PlaybackTransportRowPresenter renders a PlaybackControlsRow to display a series of playback control buttons. Typically this row will be the first row in a fragment such as the androidx.leanback.app.PlaybackSupportFragment.

The detailed description is rendered using a Presenter passed in setDescriptionPresenter(Presenter). This can be an instance of AbstractDetailsDescriptionPresenter. The application can access the detailed description ViewHolder from ViewHolder#getDescriptionViewHolder().

Summary

Nested classes

open

A ViewHolder for the PlaybackControlsRow supporting seek UI.

Public constructors

Public methods

open Float

Get default seek increment if PlaybackSeekDataProvider is null.

open OnActionClickedListener!

Returns the listener for Action click events.

open Int

Returns the primary color for the progress bar.

open Int

Returns the secondary color for the progress bar.

open Unit

open Unit

Set default seek increment if PlaybackSeekDataProvider is null.

open Unit
setDescriptionPresenter(descriptionPresenter: Presenter!)

open Unit

Sets the listener for Action click events.

open Unit

Sets the primary color for the progress bar.

open Unit

Sets the secondary color for the progress bar.

Protected methods

open RowPresenter.ViewHolder!

open Unit

open Unit

Client of progress bar is clicked, default implementation delegate click to PlayPauseAction.

open Unit

open Unit

open Unit

open Unit

Public constructors

<init>

PlaybackTransportRowPresenter()

Public methods

getDefaultSeekIncrement

open fun getDefaultSeekIncrement(): Float

Get default seek increment if PlaybackSeekDataProvider is null.

Return
Float: float value between 0(inclusive) and 1(inclusive).

getOnActionClickedListener

open fun getOnActionClickedListener(): OnActionClickedListener!

Returns the listener for Action click events.

getProgressColor

open fun getProgressColor(): Int

Returns the primary color for the progress bar. If no color was set, transparent is returned.

getSecondaryProgressColor

open fun getSecondaryProgressColor(): Int

Returns the secondary color for the progress bar. If no color was set, transparent is returned.

onReappear

open fun onReappear(rowViewHolder: RowPresenter.ViewHolder!): Unit

setDefaultSeekIncrement

open fun setDefaultSeekIncrement(ratio: Float): Unit

Set default seek increment if PlaybackSeekDataProvider is null.

Parameters
ratio Float: float value between 0(inclusive) and 1(inclusive).

setDescriptionPresenter

open fun setDescriptionPresenter(descriptionPresenter: Presenter!): Unit
Parameters
descriptionPresenter Presenter!: Presenter for displaying item details.

setOnActionClickedListener

open fun setOnActionClickedListener(listener: OnActionClickedListener!): Unit

Sets the listener for Action click events.

setProgressColor

open fun setProgressColor(color: Int): Unit

Sets the primary color for the progress bar. If not set, a default from the theme will be used.

setSecondaryProgressColor

open fun setSecondaryProgressColor(color: Int): Unit

Sets the secondary color for the progress bar. If not set, a default from the theme R.attr#playbackProgressSecondaryColor will be used.

Parameters
color Int: Color used to draw secondary progress.

Protected methods

createRowViewHolder

protected open fun createRowViewHolder(parent: ViewGroup!): RowPresenter.ViewHolder!

onBindRowViewHolder

protected open fun onBindRowViewHolder(holder: RowPresenter.ViewHolder!, item: Any!): Unit

onProgressBarClicked

protected open fun onProgressBarClicked(vh: PlaybackTransportRowPresenter.ViewHolder!): Unit

Client of progress bar is clicked, default implementation delegate click to PlayPauseAction.

Parameters
vh PlaybackTransportRowPresenter.ViewHolder!: ViewHolder of PlaybackTransportRowPresenter

onRowViewAttachedToWindow

protected open fun onRowViewAttachedToWindow(vh: RowPresenter.ViewHolder!): Unit

onRowViewDetachedFromWindow

protected open fun onRowViewDetachedFromWindow(vh: RowPresenter.ViewHolder!): Unit

onRowViewSelected

protected open fun onRowViewSelected(vh: RowPresenter.ViewHolder!, selected: Boolean): Unit

onUnbindRowViewHolder

protected open fun onUnbindRowViewHolder(holder: RowPresenter.ViewHolder!): Unit