ViewHolder

abstract class ViewHolder : RecyclerView.ViewHolder
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.ViewHolder
   ↳ androidx.car.widget.ListItem.ViewHolder

ViewHolder that supports ViewBinder.

Summary

Public constructors
<init>(itemView: View!)

Public methods
Unit

Removes customization from previous ListItem.

Unit

Stores clean up ViewBinders that will be called in cleanUp().

Protected methods
abstract Unit
applyUxRestrictions(@NonNull restrictions: CarUxRestrictions)

Applies UX restriction changes to child views.

Inherited functions
Inherited properties

Public constructors

<init>

ViewHolder(itemView: View!)

Public methods

cleanUp

fun cleanUp(): Unit

Removes customization from previous ListItem. Intended to be used when this ViewHolder is bound to a ListItem.

addCleanUp

fun addCleanUp(@Nullable cleanUp: ListItem.ViewBinder<ListItem.ViewHolder!>?): Unit

Stores clean up ViewBinders that will be called in cleanUp().

Protected methods

applyUxRestrictions

protected abstract fun applyUxRestrictions(@NonNull restrictions: CarUxRestrictions): Unit

Applies UX restriction changes to child views.

Parameters
restrictions CarUxRestrictions: current car UX restrictions.