FloatingActionButton.BaseBehavior
protected
static
class
FloatingActionButton.BaseBehavior
extends Behavior<T extends FloatingActionButton>
java.lang.Object | ||
↳ | androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<T extends com.google.android.material.floatingactionbutton.FloatingActionButton> | |
↳ | com.google.android.material.floatingactionbutton.FloatingActionButton.BaseBehavior<T extends com.google.android.material.floatingactionbutton.FloatingActionButton> |
![]() |
Behavior designed for use with FloatingActionButton
instances. Its main function is to
move FloatingActionButton
views so that any displayed Snackbar
s do not cover them.
Summary
XML attributes | |
---|---|
FloatingActionButton_Behavior_Layout_behavior_autoHide |
Public constructors | |
---|---|
FloatingActionButton.BaseBehavior()
|
|
FloatingActionButton.BaseBehavior(Context context, AttributeSet attrs)
|
Public methods | |
---|---|
boolean
|
getInsetDodgeRect(CoordinatorLayout parent, FloatingActionButton child, Rect rect)
|
boolean
|
isAutoHideEnabled()
Returns whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed. |
void
|
onAttachedToLayoutParams(CoordinatorLayout.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
|
setInternalAutoHideListener(FloatingActionButton.OnVisibilityChangedListener listener)
|
Inherited methods | |
---|---|
![]()
androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
| |
![]()
java.lang.Object
|
XML attributes
FloatingActionButton_Behavior_Layout_behavior_autoHide
Related methods:
Public constructors
FloatingActionButton.BaseBehavior
FloatingActionButton.BaseBehavior ()
FloatingActionButton.BaseBehavior
FloatingActionButton.BaseBehavior (Context context, AttributeSet attrs)
Parameters | |
---|---|
context |
Context |
attrs |
AttributeSet |
Public methods
getInsetDodgeRect
boolean getInsetDodgeRect (CoordinatorLayout parent, FloatingActionButton child, Rect rect)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
FloatingActionButton |
rect |
Rect |
Returns | |
---|---|
boolean |
isAutoHideEnabled
boolean isAutoHideEnabled ()
Returns whether the associated FloatingActionButton automatically hides when there is not enough space to be displayed.
Related XML Attributes:
Returns | |
---|---|
boolean |
true if enabled |
onAttachedToLayoutParams
void onAttachedToLayoutParams (CoordinatorLayout.LayoutParams lp)
Parameters | |
---|---|
lp |
CoordinatorLayout.LayoutParams |
onDependentViewChanged
boolean onDependentViewChanged (CoordinatorLayout parent, FloatingActionButton child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
FloatingActionButton |
dependency |
View |
Returns | |
---|---|
boolean |
onLayoutChild
boolean onLayoutChild (CoordinatorLayout parent, FloatingActionButton child, int layoutDirection)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
FloatingActionButton |
layoutDirection |
int |
Returns | |
---|---|
boolean |
setAutoHideEnabled
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
.
Related XML Attributes:
Parameters | |
---|---|
autoHide |
boolean : true to enable automatic hiding
|
setInternalAutoHideListener
void setInternalAutoHideListener (FloatingActionButton.OnVisibilityChangedListener listener)
Parameters | |
---|---|
listener |
FloatingActionButton.OnVisibilityChangedListener |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-07-20 UTC.