public final class

SwitchListItem.ViewHolder

extends ListItem.ViewHolder

 java.lang.Object

androidx.recyclerview.widget.RecyclerView.ViewHolder

androidx.car.widget.ListItem.ViewHolder

↳androidx.car.widget.SwitchListItem.ViewHolder

Overview

Holds views of SwitchListItem.

Summary

Fields
from RecyclerView.ViewHolderitemView
Constructors
publicViewHolder(View itemView)

ViewHolder that contains necessary widgets for SwitchListItem.

Methods
public TextViewgetBody()

public ImageViewgetPrimaryIcon()

public SwitchgetSwitch()

public ViewgetSwitchDivider()

public TextViewgetTitle()

public voidonUxRestrictionsChanged(CarUxRestrictions restrictionsInfo)

Updates child views with current car UX restrictions.

from ListItem.ViewHolderaddCleanUp, cleanUp
from RecyclerView.ViewHoldergetAbsoluteAdapterPosition, getAdapterPosition, getBindingAdapter, getBindingAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructors

public ViewHolder(View itemView)

ViewHolder that contains necessary widgets for SwitchListItem.

Methods

public void onUxRestrictionsChanged(CarUxRestrictions restrictionsInfo)

Updates child views with current car UX restrictions.

Text might be truncated to meet length limit required by regulation.

Parameters:

restrictionsInfo: current car UX restrictions.

public ImageView getPrimaryIcon()

public TextView getTitle()

public TextView getBody()

public View getSwitchDivider()

public Switch getSwitch()