# ListItemCardView.SwipeCallback

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

*** ** * ** ***


```
public abstract class ListItemCardView.SwipeCallback
```

<br />

*** ** * ** ***

Callback for changes to the `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem.SwipeState` of the ListItemCardView.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/listitem/ListItemCardView.SwipeCallback#SwipeCallback()()` |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/listitem/ListItemCardView.SwipeCallback#onSwipe(int)(int swipeOffset)` Called when the position of the SwipeableListItem changes. |
| `abstract void` | `<T extends View & https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem> https://developer.android.com/reference/com/google/android/material/listitem/ListItemCardView.SwipeCallback#onSwipeStateChanged(int,T,int)( int newState, T activeRevealableListItem, int revealGravity )` Called when the swipe state of the SwipeableListItem changes. |

## Public constructors

### SwipeCallback

```
public SwipeCallback()
```

## Public methods

### onSwipe

```
public abstract void onSwipe(int swipeOffset)
```

Called when the position of the SwipeableListItem changes.

| Parameters |
|---|---|
| `int swipeOffset` | The offset from the original position of the SwipeableListItem, in pixels. |

### onSwipeStateChanged

```
public abstract void <T extends View & RevealableListItem> onSwipeStateChanged(
    int newState,
    T activeRevealableListItem,
    int revealGravity
)
```

Called when the swipe state of the SwipeableListItem changes.

| Parameters |
|---|---|
| `int newState` | The new state. This will be one of `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_DRAGGING()`, `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_SETTLING()`, `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_CLOSED()`, `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_OPEN()`, or `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_SWIPE_PRIMARY_ACTION()`. |
| `T activeRevealableListItem` | The associated `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem` view that is being revealed when swiped. If the new state is `https://developer.android.com/reference/com/google/android/material/listitem/SwipeableListItem#STATE_CLOSED()`, this will be the last active `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem`. |
| `int revealGravity` | The `https://developer.android.com/reference/com/google/android/material/listitem/RevealableListItem.RevealGravity` of the revealableListItem. |