# ListItemViewHolder

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/listitem/ListItemViewHolder.java)

*** ** * ** ***


```
public class ListItemViewHolder
```

<br />

*** ** * ** ***

A flexible ViewHolder provides utility methods for binding a `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` based on an item count and position. ListItemViewHolder expects a `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` as the root itemView, or as a direct child of the itemView.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/listitem/ListItemViewHolder#ListItemViewHolder(View)(View itemView)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/listitem/ListItemViewHolder#bind()()` Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` to the adapter position by calling updateAppearance. |
| `void` | `https://developer.android.com/reference/com/google/android/material/listitem/ListItemViewHolder#bind(int)(@https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout.Position int position)` Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` according to the given `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout.Position`. |
| `void` | `https://developer.android.com/reference/com/google/android/material/listitem/ListItemViewHolder#bind(int,int)(int position, int itemCount)` Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` according given position and item count. |

## Public constructors

### ListItemViewHolder

```
public ListItemViewHolder(View itemView)
```

## Public methods

### bind

```
public void bind()
```

Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` to the adapter position by calling updateAppearance.

### bind

```
public void bind(@ListItemLayout.Position int position)
```

Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` according to the given `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout.Position`.

### bind

```
public void bind(int position, int itemCount)
```

Binds the corresponding `https://developer.android.com/reference/com/google/android/material/listitem/ListItemLayout` according given position and item count. If there are several sections in the list, the position and item count given should be relative to its section.