Google 致力于为黑人社区推动种族平等。查看具体举措

ViewHolder

open class ViewHolder : FacetProvider
kotlin.Any
   ↳ 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

Public constructors
<init>(view: View!)

Public methods
Any!
getFacet(facetClass: Class<*>!)

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

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Properties
View!

Public constructors

<init>

ViewHolder(view: View!)

Public methods

getFacet

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

setFacet

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

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Parameters
facetClass Class<*>!: Facet classes to query, can be class of ItemAlignmentFacet.
facetImpl Any!: Facet implementation.

Properties

view

val view: View!