# BaseTransientBottomBar.Behavior

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

*** ** * ** ***


```
public class BaseTransientBottomBar.Behavior extends SwipeDismissBehavior
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [com.google.android.material.behavior.SwipeDismissBehavior](https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior) ||
|   | ↳ | [com.google.android.material.snackbar.BaseTransientBottomBar.Behavior](https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.Behavior) |

*** ** * ** ***

Behavior for `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.Behavior#Behavior()()` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.Behavior#canSwipeDismissView(View)(View child)` Called when the user's input indicates that they want to swipe the given view. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.Behavior#onInterceptTouchEvent(CoordinatorLayout,View,MotionEvent)( CoordinatorLayout parent, View child, MotionEvent event )` |

| ### Inherited Constants |
|---|
| From [com.google.android.material.behavior.SwipeDismissBehavior](https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior) |---|---| | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#STATE_DRAGGING()` A view is currently being dragged. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#STATE_IDLE()` A view is not currently being dragged or animating as a result of a fling/snap. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#STATE_SETTLING()` A view is currently settling into place as a result of a fling or predefined non-interactive motion. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#SWIPE_DIRECTION_ANY() = 2` Swipe direction which allows swiping in either direction. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#SWIPE_DIRECTION_END_TO_START() = 1` Swipe direction that only allows swiping in the direction of end-to-start. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#SWIPE_DIRECTION_START_TO_END() = 0` Swipe direction that only allows swiping in the direction of start-to-end. | |

| ### Inherited fields |
|---|
| From [com.google.android.material.behavior.SwipeDismissBehavior](https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior) |---|---| | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior.OnDismissListener` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#listener()` | |

| ### Inherited methods |
|---|
| From [com.google.android.material.behavior.SwipeDismissBehavior](https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior) |---|---| | `int` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#getDragState()()` Retrieve the current drag state of this behavior. | | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior.OnDismissListener` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#getListener()()` | | `boolean` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#onLayoutChild(CoordinatorLayout,V,int)(CoordinatorLayout parent, V child, int layoutDirection)` | | `boolean` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#onTouchEvent(CoordinatorLayout,V,MotionEvent)(CoordinatorLayout parent, V child, MotionEvent event)` | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setDragDismissDistance(float)(float distance)` Set the threshold for telling if a view has been dragged enough to be dismissed. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setEndAlphaSwipeDistance(float)(float fraction)` The maximum swipe distance for the view's alpha is modified. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setListener(com.google.android.material.behavior.SwipeDismissBehavior.OnDismissListener)(https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior.OnDismissListener listener)` Set the listener to be used when a dismiss event occurs. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setSensitivity(float)(float sensitivity)` Set the sensitivity used for detecting the start of a swipe. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setStartAlphaSwipeDistance(float)(float fraction)` The minimum swipe distance before the view's alpha is modified. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/SwipeDismissBehavior#setSwipeDirection(int)(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
)
```