SwipeDismissBehavior

An interaction behavior plugin for child views of CoordinatorLayout to provide support for the 'swipe-to-dismiss' gesture.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Callback interface used to notify the application that the view has been dismissed.

Properties

Link copied to clipboard
A view is currently being dragged.
Link copied to clipboard
val STATE_IDLE: Int = 0
A view is not currently being dragged or animating as a result of a fling/snap.
Link copied to clipboard
A view is currently settling into place as a result of a fling or predefined non-interactive motion.
Link copied to clipboard
Swipe direction which allows swiping in either direction.
Link copied to clipboard
Swipe direction that only allows swiping in the direction of end-to-start.
Link copied to clipboard
Swipe direction that only allows swiping in the direction of start-to-end.

Functions

Link copied to clipboard
Called when the user's input indicates that they want to swipe the given view.
Link copied to clipboard
open fun getDragState(): Int
Retrieve the current drag state of this behavior.
Link copied to clipboard
Link copied to clipboard
open fun onLayoutChild(@NonNull parent: CoordinatorLayout, @NonNull child: V, layoutDirection: Int): Boolean
Link copied to clipboard
open fun onTouchEvent(parent: CoordinatorLayout, child: V, event: MotionEvent): Boolean
Link copied to clipboard
open fun setDragDismissDistance(distance: Float)
Set the threshold for telling if a view has been dragged enough to be dismissed.
Link copied to clipboard
open fun setEndAlphaSwipeDistance(fraction: Float)
The maximum swipe distance for the view's alpha is modified.
Link copied to clipboard
open fun setSensitivity(sensitivity: Float)
Set the sensitivity used for detecting the start of a swipe.
Link copied to clipboard
open fun setStartAlphaSwipeDistance(fraction: Float)
The minimum swipe distance before the view's alpha is modified.
Link copied to clipboard
open fun setSwipeDirection(direction: Int)
Sets the swipe direction for this behavior.