# BottomAppBar.Behavior

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

*** ** * ** ***


```
public class BottomAppBar.Behavior extends HideBottomViewOnScrollBehavior
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [com.google.android.material.behavior.HideBottomViewOnScrollBehavior](https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior) ||
|   | ↳ | [com.google.android.material.bottomappbar.BottomAppBar.Behavior](https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar.Behavior) |

*** ** * ** ***

Behavior designed for use with `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar` instances. Its main function is to link a dependent `https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton` so that it can be shown docked in the cradle.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar.Behavior#Behavior()()` |
| `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar.Behavior#Behavior(Context,AttributeSet)(Context context, AttributeSet attrs)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar.Behavior#onLayoutChild(CoordinatorLayout,com.google.android.material.bottomappbar.BottomAppBar,int)( CoordinatorLayout parent, https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar child, int layoutDirection )` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar.Behavior#onStartNestedScroll(CoordinatorLayout,com.google.android.material.bottomappbar.BottomAppBar,View,View,int,int)( CoordinatorLayout coordinatorLayout, https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar child, View directTargetChild, View target, int axes, int type )` |

| ### Inherited Constants |
|---|
| From [com.google.android.material.behavior.HideBottomViewOnScrollBehavior](https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior) |---|---| | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#STATE_SCROLLED_DOWN() = 1` State of the bottom view when it's scrolled down. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#STATE_SCROLLED_UP() = 2` State of the bottom view when it's scrolled up. | |

| ### Inherited methods |
|---|
| From [com.google.android.material.behavior.HideBottomViewOnScrollBehavior](https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior) |---|---| | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#addOnScrollStateChangedListener(com.google.android.material.behavior.HideBottomViewOnScrollBehavior.OnScrollStateChangedListener)( https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior.OnScrollStateChangedListener listener )` Adds a listener to be notified of bottom view scroll state changes. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#clearOnScrollStateChangedListeners()()` Remove all previously added `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior.OnScrollStateChangedListener`s. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#disableOnTouchExploration(boolean)(boolean disableOnTouchExploration)` Sets whether or not to disable this behavior if touch exploration is enabled. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#isDisabledOnTouchExploration()()` Returns whether or not this behavior is disabled if touch exploration is enabled. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#isScrolledDown()()` Returns true if the current state is scrolled down. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#isScrolledUp()()` Returns true if the current state is scrolled up. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#onNestedScroll(CoordinatorLayout,V,View,int,int,int,int,int,int[])( CoordinatorLayout coordinatorLayout, V child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, int[] consumed )` | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#removeOnScrollStateChangedListener(com.google.android.material.behavior.HideBottomViewOnScrollBehavior.OnScrollStateChangedListener)( https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior.OnScrollStateChangedListener listener )` Removes a previously added listener. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#setAdditionalHiddenOffsetY(V,int)(V child, int offset)` Sets an additional offset for the y position used to hide the view. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#slideDown(V)(V child)` Performs an animation that will slide the child from it's current position to be totally off the screen. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#slideDown(V,boolean)(V child, boolean animate)` Slides the child with or without animation from its current position to be totally off the screen. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#slideUp(V)(V child)` Performs an animation that will slide the child from it's current position to be totally on the screen. | | `void` | `https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior#slideUp(V,boolean)(V child, boolean animate)` Slides the child with or without animation from its current position to be totally on the screen. | |

## Public constructors

### Behavior

```
public Behavior()
```

### Behavior

```
public Behavior(Context context, AttributeSet attrs)
```

## Public methods

### onLayoutChild

```
public boolean onLayoutChild(
    CoordinatorLayout parent,
    BottomAppBar child,
    int layoutDirection
)
```

### onStartNestedScroll

```
public boolean onStartNestedScroll(
    CoordinatorLayout coordinatorLayout,
    BottomAppBar child,
    View directTargetChild,
    View target,
    int axes,
    int type
)
```