BottomAppBar.Behavior

public class BottomAppBar.Behavior extends HideBottomViewOnScrollBehavior


Behavior designed for use with BottomAppBar instances. Its main function is to link a dependent FloatingActionButton so that it can be shown docked in the cradle.

Summary

Public constructors

Behavior(Context context, AttributeSet attrs)

Public methods

boolean
onLayoutChild(
    CoordinatorLayout parent,
    BottomAppBar child,
    int layoutDirection
)
boolean
onStartNestedScroll(
    CoordinatorLayout coordinatorLayout,
    BottomAppBar child,
    View directTargetChild,
    View target,
    int axes,
    int type
)

Inherited Constants

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

State of the bottom view when it's scrolled down.

static final int

State of the bottom view when it's scrolled up.

Inherited methods

From com.google.android.material.behavior.HideBottomViewOnScrollBehavior
void

Adds a listener to be notified of bottom view scroll state changes.

void

Remove all previously added OnScrollStateChangedListeners.

void
disableOnTouchExploration(boolean disableOnTouchExploration)

Sets whether or not to disable this behavior if touch exploration is enabled.

boolean

Returns whether or not this behavior is disabled if touch exploration is enabled.

boolean

Returns true if the current state is scrolled down.

boolean

Returns true if the current state is scrolled up.

void
onNestedScroll(
    CoordinatorLayout coordinatorLayout,
    V child,
    View target,
    int dxConsumed,
    int dyConsumed,
    int dxUnconsumed,
    int dyUnconsumed,
    int type,
    int[] consumed
)
void

Removes a previously added listener.

void
setAdditionalHiddenOffsetY(V child, int offset)

Sets an additional offset for the y position used to hide the view.

void
slideDown(V child)

Performs an animation that will slide the child from it's current position to be totally off the screen.

void
slideDown(V child, boolean animate)

Slides the child with or without animation from its current position to be totally off the screen.

void
slideUp(V child)

Performs an animation that will slide the child from it's current position to be totally on the screen.

void
slideUp(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
)