# RevealableListItem

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

*** ** * ** ***


```
public interface RevealableListItem
```

<br />

Known direct subclasses [ListItemRevealLayout](https://developer.android.com/reference/com/google/android/material/listitem/ListItemRevealLayout)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/listitem/ListItemRevealLayout` | Layout that is intended to be used as the android.view.ViewGroup that is revealed when a a `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem` is swiped. |

*** ** * ** ***

Interface for the part of a ListItem that is able to be revealed when swiped.

## Summary

| ### Constants |
|---|---|
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#PRIMARY_ACTION_SWIPE_DIRECT() = 2` When swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`, swipe directly to the primary action. |
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#PRIMARY_ACTION_SWIPE_DISABLED() = 0` Disable the primary action. |
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#PRIMARY_ACTION_SWIPE_INDIRECT() = 1` When swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`, allow swiping to intermediary states before the primary action. |

| ### Public methods |
|---|---|
| `abstract int` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#getIntrinsicWidth()()` Returns the intrinsic width of the RevealableListItem. |
| `abstract int` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#getPrimaryActionSwipeMode()()` Returns the `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem.PrimaryActionSwipeMode` for the RevealableListItem that defines the swipe to primary action behavior when swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#setPrimaryActionSwipeMode(int)(int swipeToPrimaryActionMode)` Sets the `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem.PrimaryActionSwipeMode` for the RevealableListItem that defines the swipe to primary action behavior when swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem#setRevealedWidth(int)(int revealedWidth)` Sets the revealed width of RevealableListItem, in pixels. |

## Constants

### PRIMARY_ACTION_SWIPE_DIRECT

```
default static final int PRIMARY_ACTION_SWIPE_DIRECT = 2
```

When swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`, swipe directly to the primary action.

### PRIMARY_ACTION_SWIPE_DISABLED

```
default static final int PRIMARY_ACTION_SWIPE_DISABLED = 0
```

Disable the primary action.

### PRIMARY_ACTION_SWIPE_INDIRECT

```
default static final int PRIMARY_ACTION_SWIPE_INDIRECT = 1
```

When swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`, allow swiping to intermediary states before the primary action.

## Public methods

### getIntrinsicWidth

```
abstract int getIntrinsicWidth()
```

Returns the intrinsic width of the RevealableListItem. This may be 0 if an intrinsic width has not yet been measured.

### getPrimaryActionSwipeMode

```
abstract int getPrimaryActionSwipeMode()
```

Returns the `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem.PrimaryActionSwipeMode` for the RevealableListItem that defines the swipe to primary action behavior when swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`.

### setPrimaryActionSwipeMode

```
abstract void setPrimaryActionSwipeMode(int swipeToPrimaryActionMode)
```

Sets the `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem.PrimaryActionSwipeMode` for the RevealableListItem that defines the swipe to primary action behavior when swiping with a sibling `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem`.

### setRevealedWidth

```
abstract void setRevealedWidth(int revealedWidth)
```

Sets the revealed width of RevealableListItem, in pixels.