BaseTransientBottomBar.Behavior

public static class BaseTransientBottomBar.Behavior
extends SwipeDismissBehavior<View>

java.lang.Object
   ↳ androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<V extends android.view.View>
     ↳ com.google.android.material.behavior.SwipeDismissBehavior<android.view.View>
       ↳ com.google.android.material.snackbar.BaseTransientBottomBar.Behavior


Behavior for BaseTransientBottomBar.

Summary

Inherited constants

int STATE_DRAGGING

A view is currently being dragged.

int STATE_IDLE

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

int STATE_SETTLING

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

int SWIPE_DIRECTION_ANY

Swipe direction which allows swiping in either direction.

int SWIPE_DIRECTION_END_TO_START

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

int SWIPE_DIRECTION_START_TO_END

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

Public constructors

Behavior()

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 methods

boolean canSwipeDismissView(View view)

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

int getDragState()

Retrieve the current drag state of this behavior.

SwipeDismissBehavior.OnDismissListener getListener()
boolean onInterceptTouchEvent(CoordinatorLayout parent, V child, MotionEvent event)
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 setListener(SwipeDismissBehavior.OnDismissListener listener)

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 setStartAlphaSwipeDistance(float fraction)

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

void setSwipeDirection(int direction)

Sets the swipe direction for this behavior.

boolean blocksInteractionBelow(CoordinatorLayout arg0, V arg1)
boolean getInsetDodgeRect(CoordinatorLayout arg0, V arg1, Rect arg2)
int getScrimColor(CoordinatorLayout arg0, V arg1)
float getScrimOpacity(CoordinatorLayout arg0, V arg1)
static Object getTag(View arg0)
boolean layoutDependsOn(CoordinatorLayout arg0, V arg1, View arg2)
WindowInsetsCompat onApplyWindowInsets(CoordinatorLayout arg0, V arg1, WindowInsetsCompat arg2)
void onAttachedToLayoutParams(CoordinatorLayout.LayoutParams arg0)
boolean onDependentViewChanged(CoordinatorLayout arg0, V arg1, View arg2)
void onDependentViewRemoved(CoordinatorLayout arg0, V arg1, View arg2)
void onDetachedFromLayoutParams()
boolean onInterceptTouchEvent(CoordinatorLayout arg0, V arg1, MotionEvent arg2)
boolean onLayoutChild(CoordinatorLayout arg0, V arg1, int arg2)
boolean onMeasureChild(CoordinatorLayout arg0, V arg1, int arg2, int arg3, int arg4, int arg5)
boolean onNestedFling(CoordinatorLayout arg0, V arg1, View arg2, float arg3, float arg4, boolean arg5)
boolean onNestedPreFling(CoordinatorLayout arg0, V arg1, View arg2, float arg3, float arg4)
void onNestedPreScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3, int arg4, int[] arg5, int arg6)
void onNestedPreScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3, int arg4, int[] arg5)
void onNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
void onNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int[] arg8)
void onNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3, int arg4, int arg5, int arg6)
void onNestedScrollAccepted(CoordinatorLayout arg0, V arg1, View arg2, View arg3, int arg4, int arg5)
void onNestedScrollAccepted(CoordinatorLayout arg0, V arg1, View arg2, View arg3, int arg4)
boolean onRequestChildRectangleOnScreen(CoordinatorLayout arg0, V arg1, Rect arg2, boolean arg3)
void onRestoreInstanceState(CoordinatorLayout arg0, V arg1, Parcelable arg2)
Parcelable onSaveInstanceState(CoordinatorLayout arg0, V arg1)
boolean onStartNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, View arg3, int arg4, int arg5)
boolean onStartNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, View arg3, int arg4)
void onStopNestedScroll(CoordinatorLayout arg0, V arg1, View arg2, int arg3)
void onStopNestedScroll(CoordinatorLayout arg0, V arg1, View arg2)
boolean onTouchEvent(CoordinatorLayout arg0, V arg1, MotionEvent arg2)
static void setTag(View arg0, Object arg1)
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

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
child View: 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)

Parameters
parent CoordinatorLayout

child View

event MotionEvent

Returns
boolean