BaseTransientBottomBar.Behavior

public class BaseTransientBottomBar.Behavior extends SwipeDismissBehavior


Behavior for BaseTransientBottomBar.

Summary

Public constructors

Public methods

boolean
canSwipeDismissView(View child)

Called when the user's input indicates that they want to swipe the given view.

boolean
onInterceptTouchEvent(
    CoordinatorLayout parent,
    View child,
    MotionEvent event
)

Inherited Constants

From com.google.android.material.behavior.SwipeDismissBehavior
static final int

A view is currently being dragged.

static final int

A view is not currently being dragged or animating as a result of a fling/snap.

static final int

A view is currently settling into place as a result of a fling or predefined non-interactive motion.

static final int

Swipe direction which allows swiping in either direction.

static final int

Swipe direction that only allows swiping in the direction of end-to-start.

static final int

Swipe direction that only allows swiping in the direction of start-to-end.

Inherited methods

From com.google.android.material.behavior.SwipeDismissBehavior
int

Retrieve the current drag state of this behavior.

SwipeDismissBehavior.OnDismissListener
boolean
onLayoutChild(CoordinatorLayout parent, V child, int layoutDirection)
boolean
onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event)
void
setDragDismissDistance(float distance)

Set the threshold for telling if a view has been dragged enough to be dismissed.

void
setEndAlphaSwipeDistance(float fraction)

The maximum swipe distance for the view's alpha is modified.

void

Set the listener to be used when a dismiss event occurs.

void
setSensitivity(float sensitivity)

Set the sensitivity used for detecting the start of a swipe.

void

The minimum swipe distance before the view's alpha is modified.

void
setSwipeDirection(int direction)

Sets the swipe direction for this behavior.

Public constructors

Behavior

public Behavior()

Public methods

canSwipeDismissView

public boolean canSwipeDismissView(View child)

Called when the user's input indicates that they want to swipe the given view.

Parameters
View child

View the user is attempting to swipe

Returns
boolean

true if the view can be dismissed via swiping, false otherwise

onInterceptTouchEvent

public boolean onInterceptTouchEvent(
    CoordinatorLayout parent,
    View child,
    MotionEvent event
)