AbstractMediaItemPresenter.ViewHolder

class AbstractMediaItemPresenter.ViewHolder : RowPresenter.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

ViewHolder(view: View!)

Public functions

ViewGroup!
View!
TextView!
TextView!

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

TextView!
ViewFlipper!
View!
View!
Array<MultiActionsProvider.MultiAction!>!
View!
View!
Unit

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

Unit

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

Unit

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

Unit

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

Unit

Flips to the view at index 'position'.

Inherited functions

From androidx.leanback.widget.FacetProvider
abstract Any?
getFacet(facetClass: Class<Any!>)

Queries optional implemented facet.

From androidx.leanback.widget.Presenter.ViewHolder
Any!
getFacet(facetClass: Class<Any!>!)

Queries optional implemented facet.

Unit
setFacet(facetClass: Class<Any!>!, facetImpl: Any!)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

From androidx.leanback.widget.RowPresenter.ViewHolder
RowHeaderPresenter.ViewHolder!

Returns the view holder for the Row header for this Row.

BaseOnItemViewClickedListener!

Returns the listener for item click event.

BaseOnItemViewSelectedListener!

Returns the listener for item or row selection.

View.OnKeyListener!

Returns the key listener.

Row!

Returns the row bound to this ViewHolder.

Any!

Returns the Row object bound to this ViewHolder.

Float

Returns the current selection level of the Row.

Any?

Return currently selected item inside a row ViewHolder.

Presenter.ViewHolder?

Return ViewHolder of currently selected item inside a row ViewHolder.

Boolean

Returns whether the Row is in its expanded state.

Boolean

Returns whether the Row is selected.

Unit
setActivated(activated: Boolean)

Sets the row view's activated status.

Unit

Sets the listener for item click event.

Unit

Sets the listener for item or row selection.

Unit

Sets a key listener.

Unit

Synchronizes the activated status of view to the last value passed through setActivated.

Public constructors

ViewHolder

Added in 1.2.0-alpha04
ViewHolder(view: View!)

Public functions

getMediaItemActionsContainer

Added in 1.1.0
fun getMediaItemActionsContainer(): ViewGroup!
Returns
ViewGroup!

The view containing the set of custom actions

getMediaItemDetailsView

Added in 1.1.0
fun getMediaItemDetailsView(): View!
Returns
View!

The view container of media item details

getMediaItemDurationView

Added in 1.1.0
fun getMediaItemDurationView(): TextView!
Returns
TextView!

The TextView responsible for rendering the media item duration

getMediaItemNameView

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

Returns
TextView!

The TextView responsible for rendering the media item name.

getMediaItemNumberView

Added in 1.1.0
fun getMediaItemNumberView(): TextView!
Returns
TextView!

The TextView responsible for rendering the media item number. This view is rendered when the media item row is neither playing nor paused.

getMediaItemNumberViewFlipper

Added in 1.1.0
fun getMediaItemNumberViewFlipper(): ViewFlipper!
Returns
ViewFlipper!

The FlipperView responsible for flipping between different media item number views depending on the playback state

getMediaItemPausedView

Added in 1.1.0
fun getMediaItemPausedView(): View!
Returns
View!

The view rendered when the media item row is paused.

getMediaItemPlayingView

Added in 1.1.0
fun getMediaItemPlayingView(): View!
Returns
View!

The view rendered when the media item row is playing.

getMediaItemRowActions

Added in 1.1.0
fun getMediaItemRowActions(): Array<MultiActionsProvider.MultiAction!>!
Returns
Array<MultiActionsProvider.MultiAction!>!

Array of MultiActions displayed for this media item row

getMediaItemRowSeparator

Added in 1.1.0
fun getMediaItemRowSeparator(): View!
Returns
View!

The view responsible for rendering the separator line between media rows

getSelectorView

Added in 1.1.0
fun getSelectorView(): View!
Returns
View!

The SelectorView responsible for highlighting the in-focus view within each media item row

notifyActionChanged

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

notifyDetailsChanged

Added in 1.1.0
fun notifyDetailsChanged(): Unit

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

notifyPlayStateChanged

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

onBindRowActions

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

setSelectedMediaItemNumberView

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