AbstractDetailsDescriptionPresenter


abstract class AbstractDetailsDescriptionPresenter : Presenter


An abstract Presenter for rendering a detailed description of an item. Typically this Presenter will be used in a FullWidthDetailsOverviewRowPresenter or PlaybackControlsRowPresenter.

Subclasses must override onBindDescription to implement the data binding for this Presenter.

Summary

Public constructors

Public functions

Unit
onBindViewHolder(viewHolder: Presenter.ViewHolder, item: Any?)

Binds a View to an item.

AbstractDetailsDescriptionPresenter.ViewHolder

Creates a new View.

Unit

Unbinds a View from an item.

Unit

Called when a view created by this presenter has been attached to a window.

Unit

Called when a view created by this presenter has been detached from its window.

Protected functions

abstract Unit

Binds the data from the item to the ViewHolder.

Inherited functions

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

Queries optional implemented facet.

From androidx.leanback.widget.Presenter
java-static Unit

Utility method for removing all running animations on a view.

Any!
getFacet(facetClass: Class<Any!>!)

Queries optional implemented facet.

Unit
onBindViewHolder(
    viewHolder: Presenter.ViewHolder,
    item: Any,
    payloads: (Mutable)List<Any!>
)

Binds a View to an item with a list of payloads.

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

Sets dynamic implemented facet in addition to basic Presenter functions.

Unit
setOnClickListener(
    holder: Presenter.ViewHolder!,
    listener: View.OnClickListener!
)

Called to set a click listener for the given view holder.

Public constructors

AbstractDetailsDescriptionPresenter

Added in 1.1.0
AbstractDetailsDescriptionPresenter()

Public functions

onBindViewHolder

Added in 1.2.0-alpha04
fun onBindViewHolder(viewHolder: Presenter.ViewHolder, item: Any?): Unit

Binds a View to an item.

onCreateViewHolder

Added in 1.2.0-alpha04
fun onCreateViewHolder(parent: ViewGroup): AbstractDetailsDescriptionPresenter.ViewHolder

Creates a new View.

onUnbindViewHolder

Added in 1.2.0-alpha04
fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder): Unit

Unbinds a 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.

onViewAttachedToWindow

fun onViewAttachedToWindow(holder: Presenter.ViewHolder): Unit

Called when a view created by this presenter has been attached to a window.

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 onViewDetachedFromWindow those resources should be restored here.

Parameters
holder: Presenter.ViewHolder

Holder of the view being attached

onViewDetachedFromWindow

fun onViewDetachedFromWindow(holder: Presenter.ViewHolder): Unit

Called when a view created by this presenter has been detached from its window.

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.
Parameters
holder: Presenter.ViewHolder

Holder of the view being detached

Protected functions

onBindDescription

Added in 1.1.0
protected abstract fun onBindDescription(
    vh: AbstractDetailsDescriptionPresenter.ViewHolder,
    item: Any
): Unit

Binds the data from the item to the ViewHolder. The item is typically associated with a DetailsOverviewRow or PlaybackControlsRow.

Parameters
vh: AbstractDetailsDescriptionPresenter.ViewHolder

The ViewHolder for this details description view.

item: Any

The item being presented.