public abstract class AbstractDetailsDescriptionPresenter extends Presenter
Presenter
for rendering a detailed description of an
item. Typically this Presenter will be used in a DetailsOverviewRowPresenter
or PlaybackControlsRowPresenter
.
Subclasses must override onBindDescription(android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter.ViewHolder, java.lang.Object)
to implement the data
binding for this Presenter.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractDetailsDescriptionPresenter.ViewHolder
The ViewHolder for the
AbstractDetailsDescriptionPresenter . |
Presenter.ViewHolderTask
Constructor and Description |
---|
AbstractDetailsDescriptionPresenter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
onBindDescription(AbstractDetailsDescriptionPresenter.ViewHolder vh,
Object item)
Binds the data from the item to the ViewHolder.
|
void |
onBindViewHolder(Presenter.ViewHolder viewHolder,
Object item)
Binds a
View to an item. |
AbstractDetailsDescriptionPresenter.ViewHolder |
onCreateViewHolder(ViewGroup parent)
Creates a new
View . |
void |
onUnbindViewHolder(Presenter.ViewHolder viewHolder)
Unbinds a
View from an item. |
void |
onViewAttachedToWindow(Presenter.ViewHolder holder)
Called when a view created by this presenter has been attached to a window.
|
void |
onViewDetachedFromWindow(Presenter.ViewHolder holder)
Called when a view created by this presenter has been detached from its window.
|
cancelAnimationsRecursive, getFacet, setFacet, setOnClickListener
public final AbstractDetailsDescriptionPresenter.ViewHolder onCreateViewHolder(ViewGroup parent)
Presenter
View
.onCreateViewHolder
in class Presenter
public final void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)
Presenter
View
to an item.onBindViewHolder
in class Presenter
protected abstract void onBindDescription(AbstractDetailsDescriptionPresenter.ViewHolder vh, Object item)
DetailsOverviewRow
or PlaybackControlsRow
.vh
- The ViewHolder for this details description view.item
- The item being presented.public void onUnbindViewHolder(Presenter.ViewHolder viewHolder)
Presenter
View
from an item. Any expensive references may be
released here, and any fields that are not bound for every item should be
cleared here.onUnbindViewHolder
in class Presenter
public void onViewAttachedToWindow(Presenter.ViewHolder holder)
Presenter
This can be used as a reasonable signal that the view is about to be seen
by the user. If the adapter previously freed any resources in
Presenter.onViewDetachedFromWindow(ViewHolder)
those resources should be restored here.
onViewAttachedToWindow
in class Presenter
holder
- Holder of the view being attachedpublic void onViewDetachedFromWindow(Presenter.ViewHolder holder)
Presenter
Becoming detached from the window is not necessarily a permanent condition; the consumer of an presenter's views may choose to cache views offscreen while they are not visible, attaching and detaching them as appropriate.
Any view property animations should be cancelled here or the view may fail to be recycled.onViewDetachedFromWindow
in class Presenter
holder
- Holder of the view being detached