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

Presenter.ViewHolder

public static class Presenter.ViewHolder
extends Object implements FacetProvider

java.lang.Object
   ↳ androidx.leanback.widget.Presenter.ViewHolder


ViewHolder can be subclassed and used to cache any view accessors needed to improve binding performance (for example, results of findViewById) without needing to subclass a View.

Summary

Fields

public final View view

Public constructors

Presenter.ViewHolder(View view)

Public methods

final Object getFacet(Class<?> facetClass)

Queries optional implemented facet.

final void setFacet(Class<?> facetClass, Object facetImpl)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Inherited methods

Fields

view

added in version 1.0.0
public final View view

Public constructors

Presenter.ViewHolder

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

Parameters
view View

Public methods

getFacet

added in version 1.0.0
public final Object getFacet (Class<?> facetClass)

Queries optional implemented facet.

Parameters
facetClass Class: Facet classes to query, examples are: class of ItemAlignmentFacet.

Returns
Object Facet implementation for the facetClass or null if feature not implemented.

setFacet

added in version 1.0.0
public final void setFacet (Class<?> facetClass, 
                Object facetImpl)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Parameters
facetClass Class: Facet classes to query, can be class of ItemAlignmentFacet.

facetImpl Object: Facet implementation.