FloatingActionButton.BaseBehavior

protected class FloatingActionButton.BaseBehavior<T extends FloatingActionButton>

Known direct subclasses
FloatingActionButton.Behavior

Behavior designed for use with FloatingActionButton instances.


Behavior designed for use with FloatingActionButton instances. Its main function is to move FloatingActionButton views so that any displayed s do not cover them.

Summary

Public constructors

BaseBehavior(Context context, AttributeSet attrs)

Public methods

boolean
getInsetDodgeRect(
    CoordinatorLayout parent,
    FloatingActionButton child,
    Rect rect
)
boolean

Returns whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed.

void
onAttachedToLayoutParams(LayoutParams lp)
boolean
onDependentViewChanged(
    CoordinatorLayout parent,
    FloatingActionButton child,
    View dependency
)
boolean
onLayoutChild(
    CoordinatorLayout parent,
    FloatingActionButton child,
    int layoutDirection
)
void
setAutoHideEnabled(boolean autoHide)

Sets whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed.

void

Public constructors

BaseBehavior

public BaseBehavior()

BaseBehavior

public BaseBehavior(Context context, AttributeSet attrs)

Public methods

getInsetDodgeRect

public boolean getInsetDodgeRect(
    CoordinatorLayout parent,
    FloatingActionButton child,
    Rect rect
)

isAutoHideEnabled

public boolean isAutoHideEnabled()

Returns whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed.

ref com.google.android.material.R.styleable#FloatingActionButton_Behavior_Layout_behavior_autoHide

Returns
boolean

true if enabled

onAttachedToLayoutParams

public void onAttachedToLayoutParams(LayoutParams lp)

onDependentViewChanged

public boolean onDependentViewChanged(
    CoordinatorLayout parent,
    FloatingActionButton child,
    View dependency
)

onLayoutChild

public boolean onLayoutChild(
    CoordinatorLayout parent,
    FloatingActionButton child,
    int layoutDirection
)

setAutoHideEnabled

public void setAutoHideEnabled(boolean autoHide)

Sets whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed. This works with AppBarLayout and BottomSheetBehavior.

ref com.google.android.material.R.styleable#FloatingActionButton_Behavior_Layout_behavior_autoHide

Parameters
boolean autoHide

true to enable automatic hiding

setInternalAutoHideListener

public void setInternalAutoHideListener(
    FloatingActionButton.OnVisibilityChangedListener listener
)