SwitchListItem.ViewHolder

public static 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


Holds views of SwitchListItem.

Summary

Inherited fields

Public constructors

SwitchListItem.ViewHolder(View itemView)

ViewHolder that contains necessary widgets for SwitchListItem.

Public methods

TextView getBody()
ImageView getPrimaryIcon()
Switch getSwitch()
View getSwitchDivider()
TextView getTitle()
void onUxRestrictionsChanged(CarUxRestrictions restrictionsInfo)

Updates child views with current car UX restrictions.

Inherited methods

Public constructors

SwitchListItem.ViewHolder

public SwitchListItem.ViewHolder (View itemView)

ViewHolder that contains necessary widgets for SwitchListItem.

Parameters
itemView View

Public methods

getBody

public TextView getBody ()

Returns
TextView

getPrimaryIcon

public ImageView getPrimaryIcon ()

Returns
ImageView

getSwitch

public Switch getSwitch ()

Returns
Switch

getSwitchDivider

public View getSwitchDivider ()

Returns
View

getTitle

public TextView getTitle ()

Returns
TextView

onUxRestrictionsChanged

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 CarUxRestrictions: current car UX restrictions.