public class

AbstractMediaItemPresenter.ViewHolder

extends RowPresenter.ViewHolder

 java.lang.Object

androidx.leanback.widget.Presenter.ViewHolder

androidx.leanback.widget.RowPresenter.ViewHolder

↳androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder

Overview

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

Fields
from RowPresenter.ViewHoldermColorDimmer
from Presenter.ViewHolderview
Constructors
publicViewHolder(View view)

Methods
public ViewGroupgetMediaItemActionsContainer()

public ViewgetMediaItemDetailsView()

public TextViewgetMediaItemDurationView()

public TextViewgetMediaItemNameView()

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

public TextViewgetMediaItemNumberView()

public ViewFlippergetMediaItemNumberViewFlipper()

public ViewgetMediaItemPausedView()

public ViewgetMediaItemPlayingView()

public MultiActionsProvider.MultiActiongetMediaItemRowActions()

public ViewgetMediaItemRowSeparator()

public ViewgetSelectorView()

public voidnotifyActionChanged(MultiActionsProvider.MultiAction action)

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

public voidnotifyDetailsChanged()

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

public voidnotifyPlayStateChanged()

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

public voidonBindRowActions()

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

public voidsetSelectedMediaItemNumberView(int position)

Flips to the view at index 'position'.

from RowPresenter.ViewHoldergetHeaderViewHolder, getOnItemViewClickedListener, getOnItemViewSelectedListener, getOnKeyListener, getRow, getRowObject, getSelectedItem, getSelectedItemViewHolder, getSelectLevel, isExpanded, isSelected, setActivated, setOnItemViewClickedListener, setOnItemViewSelectedListener, setOnKeyListener, syncActivatedStatus
from Presenter.ViewHoldergetFacet, setFacet
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public ViewHolder(View view)

Methods

public void onBindRowActions()

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.

public void notifyActionChanged(MultiActionsProvider.MultiAction action)

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

Parameters:

action: The action whose state has changed

public void notifyDetailsChanged()

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

public void notifyPlayStateChanged()

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.

public View getSelectorView()

Returns:

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

public ViewFlipper getMediaItemNumberViewFlipper()

Returns:

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

public TextView getMediaItemNumberView()

Returns:

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

public View getMediaItemPausedView()

Returns:

The view rendered when the media item row is paused.

public View getMediaItemPlayingView()

Returns:

The view rendered when the media item row is playing.

public void setSelectedMediaItemNumberView(int position)

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: The index of the child view to display.

public TextView getMediaItemNameView()

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

Returns:

The TextView responsible for rendering the media item name.

public TextView getMediaItemDurationView()

Returns:

The TextView responsible for rendering the media item duration

public View getMediaItemDetailsView()

Returns:

The view container of media item details

public View getMediaItemRowSeparator()

Returns:

The view responsible for rendering the separator line between media rows

public ViewGroup getMediaItemActionsContainer()

Returns:

The view containing the set of custom actions

public MultiActionsProvider.MultiAction getMediaItemRowActions()

Returns:

Array of MultiActions displayed for this media item row