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

ViewHolder

open class ViewHolder : RowPresenter.ViewHolder
kotlin.Any
   ↳ androidx.leanback.widget.Presenter.ViewHolder
   ↳ androidx.leanback.widget.RowPresenter.ViewHolder
   ↳ androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder

The ViewHolder for the AbstractMediaItemPresenter. It references different views that place different meta-data corresponding to a media item details, actions, selector, listeners, and presenters,

Summary

Public constructors
<init>(view: View!)

Public methods
open Unit

Flips to the view at index 'position'.

open Unit

Notifies an action has changed in this media row and the UI needs to be updated

open TextView!

open TextView!

Returns the view displayed when the media item is neither playing nor paused, corresponding to the playback state of PLAY_STATE_INITIAL.

open Unit

Binds the actions in a media item row object to their views.

open ViewFlipper!

open View!

open View!

open View!

open Unit

Notifies the content of the media item details in a row has changed and triggers updating the UI.

open View!

open Unit

Notifies the playback state of the media item row has changed.

open ViewGroup!

open TextView!

open View!

open Array<MultiActionsProvider.MultiAction!>!

Inherited functions
Inherited properties

Public constructors

<init>

ViewHolder(view: View!)

Public methods

setSelectedMediaItemNumberView

open fun setSelectedMediaItemNumberView(position: Int): Unit

Flips to the view at index 'position'. This position corresponds to the index of a particular view within the ViewFlipper layout specified for the MediaItemNumberView (see playbackMediaItemNumberViewFlipperLayout attribute).

Parameters
position Int: The index of the child view to display.

notifyActionChanged

open fun notifyActionChanged(action: MultiActionsProvider.MultiAction!): Unit

Notifies an action has changed in this media row and the UI needs to be updated

Parameters
action MultiActionsProvider.MultiAction!: The action whose state has changed

getMediaItemDurationView

open fun getMediaItemDurationView(): TextView!
Return
TextView!: The TextView responsible for rendering the media item duration

getMediaItemNameView

open fun getMediaItemNameView(): TextView!

Returns the view displayed when the media item is neither playing nor paused, corresponding to the playback state of PLAY_STATE_INITIAL.

Return
TextView!: The TextView responsible for rendering the media item name.

onBindRowActions

open fun onBindRowActions(): Unit

Binds the actions in a media item row object to their views. This consists of creating (or reusing the existing) action view holders, and populating them with the actions' icons.

getMediaItemNumberViewFlipper

open fun getMediaItemNumberViewFlipper(): ViewFlipper!
Return
ViewFlipper!: The FlipperView responsible for flipping between different media item number views depending on the playback state

getMediaItemRowSeparator

open fun getMediaItemRowSeparator(): View!
Return
View!: The view responsible for rendering the separator line between media rows

getMediaItemDetailsView

open fun getMediaItemDetailsView(): View!
Return
View!: The view container of media item details

getSelectorView

open fun getSelectorView(): View!
Return
View!: The SelectorView responsible for highlighting the in-focus view within each media item row

notifyDetailsChanged

open fun notifyDetailsChanged(): Unit

Notifies the content of the media item details in a row has changed and triggers updating the UI. This causes onBindMediaDetails(ViewHolder, Object) on the user's provided presenter to be called back, allowing them to update UI accordingly.

getMediaItemPausedView

open fun getMediaItemPausedView(): View!
Return
View!: The view rendered when the media item row is paused.

notifyPlayStateChanged

open fun notifyPlayStateChanged(): Unit

Notifies the playback state of the media item row has changed. This in turn triggers updating of the UI for that media item row if corresponding views are specified for each playback state. By default, 3 views are provided for each playback state, or these views can be provided by the user.

getMediaItemActionsContainer

open fun getMediaItemActionsContainer(): ViewGroup!
Return
ViewGroup!: The view containing the set of custom actions

getMediaItemNumberView

open fun getMediaItemNumberView(): TextView!
Return
TextView!: The TextView responsible for rendering the media item number. This view is rendered when the media item row is neither playing nor paused.

getMediaItemPlayingView

open fun getMediaItemPlayingView(): View!
Return
View!: The view rendered when the media item row is playing.

getMediaItemRowActions

open fun getMediaItemRowActions(): Array<MultiActionsProvider.MultiAction!>!
Return
Array<MultiActionsProvider.MultiAction!>!: Array of MultiActions displayed for this media item row