Presenter.ViewHolder


public class Presenter.ViewHolder implements FacetProvider


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

Public fields

final View

Public constructors

Public methods

final Object
getFacet(Class<Object> facetClass)

Queries optional implemented facet.

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

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Public fields

view

Added in 1.1.0
public final View view

Public constructors

ViewHolder

Added in 1.1.0
public ViewHolder(View view)

Public methods

getFacet

Added in 1.2.0-alpha04
public final Object getFacet(Class<Object> facetClass)

Queries optional implemented facet.

Parameters
Class<Object> facetClass

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 1.1.0
public final void setFacet(Class<Object> facetClass, Object facetImpl)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Parameters
Class<Object> facetClass

Facet classes to query, can be class of ItemAlignmentFacet.

Object facetImpl

Facet implementation.