added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0-beta01

AbstractMediaItemPresenter.ViewHolder

public static class AbstractMediaItemPresenter.ViewHolder
extends RowPresenter.ViewHolder

java.lang.Object
   ↳ 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

Inherited fields

Public constructors

AbstractMediaItemPresenter.ViewHolder(View view)

Public methods

ViewGroup getMediaItemActionsContainer()
View getMediaItemDetailsView()
TextView getMediaItemDurationView()
TextView getMediaItemNameView()

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

TextView getMediaItemNumberView()
ViewFlipper getMediaItemNumberViewFlipper()
View getMediaItemPausedView()
View getMediaItemPlayingView()
MultiAction[] getMediaItemRowActions()
View getMediaItemRowSeparator()
View getSelectorView()
void notifyActionChanged(MultiActionsProvider.MultiAction action)

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

void notifyDetailsChanged()

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

void notifyPlayStateChanged()

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

void onBindRowActions()

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

void setSelectedMediaItemNumberView(int position)

Flips to the view at index 'position'.

Inherited methods

Public constructors

AbstractMediaItemPresenter.ViewHolder

added in version 1.0.0
public AbstractMediaItemPresenter.ViewHolder (View view)

Parameters
view View

Public methods

getMediaItemActionsContainer

added in version 1.0.0
public ViewGroup getMediaItemActionsContainer ()

Returns
ViewGroup The view containing the set of custom actions

getMediaItemDetailsView

added in version 1.0.0
public View getMediaItemDetailsView ()

Returns
View The view container of media item details

getMediaItemDurationView

added in version 1.0.0
public TextView getMediaItemDurationView ()

Returns
TextView The TextView responsible for rendering the media item duration

getMediaItemNameView

added in version 1.0.0
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
TextView The TextView responsible for rendering the media item name.

getMediaItemNumberView

added in version 1.0.0
public TextView getMediaItemNumberView ()

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 version 1.0.0
public ViewFlipper getMediaItemNumberViewFlipper ()

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

getMediaItemPausedView

added in version 1.0.0
public View getMediaItemPausedView ()

Returns
View The view rendered when the media item row is paused.

getMediaItemPlayingView

added in version 1.0.0
public View getMediaItemPlayingView ()

Returns
View The view rendered when the media item row is playing.

getMediaItemRowActions

added in version 1.0.0
public MultiAction[] getMediaItemRowActions ()

Returns
MultiAction[] Array of MultiActions displayed for this media item row

getMediaItemRowSeparator

added in version 1.0.0
public View getMediaItemRowSeparator ()

Returns
View The view responsible for rendering the separator line between media rows

getSelectorView

added in version 1.0.0
public View getSelectorView ()

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

notifyActionChanged

added in version 1.0.0
public void notifyActionChanged (MultiActionsProvider.MultiAction action)

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 version 1.0.0
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(ViewHolder, Object) on the user's provided presenter to be called back, allowing them to update UI accordingly.

notifyPlayStateChanged

added in version 1.0.0
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.

onBindRowActions

added in version 1.0.0
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.

setSelectedMediaItemNumberView

added in version 1.0.0
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 int: The index of the child view to display.