car/src/main/java/androidx/car/widget/ListItemAdapter.java
public void registerListItemViewType(int viewType, @LayoutRes int layoutResId,
            Function<View, ListItem.ViewHolder> function) {
        if (mViewHolderLayoutResIds.get(viewType) != 0
                || mViewHolderCreator.get(viewType) != null) {
            throw new IllegalArgumentException("View type is already registered.");
        }
        mViewHolderCreator.put(viewType, function);
        mViewHolderLayoutResIds.put(viewType, layoutResId);
    }
/**
     * Registers a function that returns {@link RecyclerView.ViewHolder}
     * for its matching view type returned by {@link ListItem#getViewType()}.
     *
     * <p>The function will receive a view as {@link RecyclerView.ViewHolder#itemView}. This view
     * uses background defined by {@link BackgroundStyle}.
     *
     * <p>Subclasses of {@link ListItem} in package androidx.car.widget are already registered.
     *
     * @param viewType use negative value for custom view type.
     * @param function function to create ViewHolder for {@code viewType}.
     */
Registers a function that returns  RecyclerView.ViewHolder
for its matching view type returned by  ListItem#getViewType().

The function will receive a view as  RecyclerView.ViewHolder#itemView. This view
uses background defined by  BackgroundStyle.

Subclasses of  ListItem in package androidx.car.widget are already registered.

@param viewType use negative value for custom view type.
@param function function to create ViewHolder for  viewType.
Registers a function that returns RecyclerView . ViewHolder for its matching view type returned by ListItem#getViewType () . The function will receive a view as RecyclerView . ViewHolder#itemView . This view uses background defined by BackgroundStyle . Subclasses of ListItem in package androidx . car . widget are already registered . @param viewType use negative value for custom view type . @param function function to create ViewHolder for viewType .
public void registerListItemViewType(int viewType, @LayoutRes int layoutResId,
            Function<View, ListItem.ViewHolder> function) {
        if (mViewHolderLayoutResIds.get(viewType) != 0
                || mViewHolderCreator.get(viewType) != null) {
            throw new IllegalArgumentException("View type is already registered.");
        }
        mViewHolderCreator.put(viewType, function);
        mViewHolderLayoutResIds.put(viewType, layoutResId);
    }
public void registerListItemViewType ( int viewType , @ LayoutRes int layoutResId , Function < View , ListItem . ViewHolder > function ) { if ( mViewHolderLayoutResIds . get ( viewType ) != 0 || mViewHolderCreator . get ( viewType ) != null ) { throw new IllegalArgumentException ( "View type is already registered." ) ; } mViewHolderCreator . put ( viewType , function ) ; mViewHolderLayoutResIds . put ( viewType , layoutResId ) ; }
Registers a function that returns {@link RecyclerView.ViewHolder}
 for its matching view type returned by {@link ListItem#getViewType()}.
Registers a function that returns { @link RecyclerView . ViewHolder } for its matching view type returned by { @link ListItem#getViewType () } .