Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ViewHolder

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

Holds the children views of ActionListItem.

Summary

Public constructors

<init>(@NonNull itemView: View)

Public methods

TextView

Button

View

ImageView

Button

View

TextView

Unit

Unit

Sets if the action returned is styled as borderless or non-borderless.

Inherited functions

Inherited properties

Public constructors

<init>

ViewHolder(@NonNull itemView: View)

Public methods

getBody

@NonNull fun getBody(): TextView

getPrimaryAction

@NonNull fun getPrimaryAction(): Button

getPrimaryActionDivider

@NonNull fun getPrimaryActionDivider(): View

getPrimaryIcon

@NonNull fun getPrimaryIcon(): ImageView

getSecondaryAction

@NonNull fun getSecondaryAction(): Button

getSecondaryActionDivider

@NonNull fun getSecondaryActionDivider(): View

getTitle

@NonNull fun getTitle(): TextView

onUxRestrictionsChanged

fun onUxRestrictionsChanged(@NonNull restrictions: CarUxRestrictions): Unit

setActionBorderless

fun setActionBorderless(isBorderless: Boolean): Unit

Sets if the action returned is styled as borderless or non-borderless.

By default, this value is true.

Parameters
isBorderless Boolean: Whether or not the action is borderless.