ListItemCardView.SwipeCallback


public abstract class ListItemCardView.SwipeCallback


Callback for changes to the SwipeState of the ListItemCardView.

Summary

Public constructors

Public methods

abstract void
onSwipe(int swipeOffset)

Called when the position of the SwipeableListItem changes.

abstract void
<T extends View & RevealableListItem> onSwipeStateChanged(
    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 STATE_DRAGGING, STATE_SETTLING, STATE_CLOSED, STATE_OPEN, or STATE_SWIPE_PRIMARY_ACTION.

T activeRevealableListItem

The associated RevealableListItem view that is being revealed when swiped. If the new state is STATE_CLOSED, this will be the last active RevealableListItem.

int revealGravity

The RevealGravity of the revealableListItem.