ExtendedFloatingActionButton.ExtendedFloatingActionButtonBehavior

protected static class ExtendedFloatingActionButton.ExtendedFloatingActionButtonBehavior
extends Behavior<T extends ExtendedFloatingActionButton>

java.lang.Object
   ↳ androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<T extends com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton>
     ↳ com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.ExtendedFloatingActionButtonBehavior<T extends com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton>


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

Summary

Public constructors

ExtendedFloatingActionButtonBehavior()
ExtendedFloatingActionButtonBehavior(Context context, AttributeSet attrs)

Public methods

boolean getInsetDodgeRect(CoordinatorLayout parent, ExtendedFloatingActionButton child, Rect rect)
boolean isAutoHideEnabled()

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

boolean isAutoShrinkEnabled()

Returns whether the associated ExtendedFloatingActionButton automatically shrinks when there is not enough space to be displayed.

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

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

void setAutoShrinkEnabled(boolean autoShrink)

Sets whether the associated ExtendedFloatingActionButton automatically shrink when there is not enough space to be displayed.

Protected methods

void extendOrShow(ExtendedFloatingActionButton fab)

Extends the Extended FAB, in case auto-shrink is enabled, or show it in case auto-hide is enabled.

void shrinkOrHide(ExtendedFloatingActionButton fab)

Shrinks the Extended FAB, in case auto-shrink is enabled, or hides it in case auto-hide is enabled.

Inherited methods

boolean blocksInteractionBelow(CoordinatorLayout arg0, T arg1)
boolean getInsetDodgeRect(CoordinatorLayout arg0, T arg1, Rect arg2)
int getScrimColor(CoordinatorLayout arg0, T arg1)
float getScrimOpacity(CoordinatorLayout arg0, T arg1)
static Object getTag(View arg0)
boolean layoutDependsOn(CoordinatorLayout arg0, T arg1, View arg2)
WindowInsetsCompat onApplyWindowInsets(CoordinatorLayout arg0, T arg1, WindowInsetsCompat arg2)
void onAttachedToLayoutParams(CoordinatorLayout.LayoutParams arg0)
boolean onDependentViewChanged(CoordinatorLayout arg0, T arg1, View arg2)
void onDependentViewRemoved(CoordinatorLayout arg0, T arg1, View arg2)
void onDetachedFromLayoutParams()
boolean onInterceptTouchEvent(CoordinatorLayout arg0, T arg1, MotionEvent arg2)
boolean onLayoutChild(CoordinatorLayout arg0, T arg1, int arg2)
boolean onMeasureChild(CoordinatorLayout arg0, T arg1, int arg2, int arg3, int arg4, int arg5)
boolean onNestedFling(CoordinatorLayout arg0, T arg1, View arg2, float arg3, float arg4, boolean arg5)
boolean onNestedPreFling(CoordinatorLayout arg0, T arg1, View arg2, float arg3, float arg4)
void onNestedPreScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3, int arg4, int[] arg5, int arg6)
void onNestedPreScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3, int arg4, int[] arg5)
void onNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
void onNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int[] arg8)
void onNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3, int arg4, int arg5, int arg6)
void onNestedScrollAccepted(CoordinatorLayout arg0, T arg1, View arg2, View arg3, int arg4, int arg5)
void onNestedScrollAccepted(CoordinatorLayout arg0, T arg1, View arg2, View arg3, int arg4)
boolean onRequestChildRectangleOnScreen(CoordinatorLayout arg0, T arg1, Rect arg2, boolean arg3)
void onRestoreInstanceState(CoordinatorLayout arg0, T arg1, Parcelable arg2)
Parcelable onSaveInstanceState(CoordinatorLayout arg0, T arg1)
boolean onStartNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, View arg3, int arg4, int arg5)
boolean onStartNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, View arg3, int arg4)
void onStopNestedScroll(CoordinatorLayout arg0, T arg1, View arg2, int arg3)
void onStopNestedScroll(CoordinatorLayout arg0, T arg1, View arg2)
boolean onTouchEvent(CoordinatorLayout arg0, T 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()

XML attributes

ExtendedFloatingActionButton_Behavior_Layout_behavior_autoHide

Related methods:

ExtendedFloatingActionButton_Behavior_Layout_behavior_autoShrink

Related methods:

Public constructors

ExtendedFloatingActionButtonBehavior

public ExtendedFloatingActionButtonBehavior ()

ExtendedFloatingActionButtonBehavior

public ExtendedFloatingActionButtonBehavior (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Public methods

getInsetDodgeRect

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

Parameters
parent CoordinatorLayout

child ExtendedFloatingActionButton

rect Rect

Returns
boolean

isAutoHideEnabled

public boolean isAutoHideEnabled ()

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

Related XML Attributes:

Returns
boolean true if enabled

isAutoShrinkEnabled

public boolean isAutoShrinkEnabled ()

Returns whether the associated ExtendedFloatingActionButton automatically shrinks when there is not enough space to be displayed.

Related XML Attributes:

Returns
boolean true if enabled

onAttachedToLayoutParams

public void onAttachedToLayoutParams (CoordinatorLayout.LayoutParams lp)

Parameters
lp CoordinatorLayout.LayoutParams

onDependentViewChanged

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

Parameters
parent CoordinatorLayout

child ExtendedFloatingActionButton

dependency View

Returns
boolean

onLayoutChild

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

Parameters
parent CoordinatorLayout

child ExtendedFloatingActionButton

layoutDirection int

Returns
boolean

setAutoHideEnabled

public void setAutoHideEnabled (boolean autoHide)

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

In case auto-shrink is enabled, it will take precedence over the auto-hide option.

Related XML Attributes:

Parameters
autoHide boolean: true to enable automatic hiding

setAutoShrinkEnabled

public void setAutoShrinkEnabled (boolean autoShrink)

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

Related XML Attributes:

Parameters
autoShrink boolean: true to enable automatic shrinking

Protected methods

extendOrShow

protected void extendOrShow (ExtendedFloatingActionButton fab)

Extends the Extended FAB, in case auto-shrink is enabled, or show it in case auto-hide is enabled. The priority is given to the default extend option, and the button will be shown only when the auto-shrink is false and auto-hide is true.

Related XML Attributes:

Parameters
fab ExtendedFloatingActionButton

shrinkOrHide

protected void shrinkOrHide (ExtendedFloatingActionButton fab)

Shrinks the Extended FAB, in case auto-shrink is enabled, or hides it in case auto-hide is enabled. The priority is given to the default shrink option, and the button will be hidden only when the auto-shrink is false and auto-hide is true.

Related XML Attributes:

Parameters
fab ExtendedFloatingActionButton