FabTransformationSheetBehavior

public class FabTransformationSheetBehavior extends FabTransformationBehavior


Behavior that should be attached to any sheet that should appear when a is setExpanded expanded}.

A sheet usually has some width and height that's smaller than the screen, has an elevation, and may have a scrim underneath.

Summary

Public constructors

FabTransformationSheetBehavior(Context context, AttributeSet attrs)

Protected methods

FabTransformationBehavior.FabTransformationSpec
onCreateMotionSpec(Context context, boolean expanded)
boolean
onExpandedStateChange(
    View dependency,
    View child,
    boolean expanded,
    boolean animated
)

Reacts to a change in expanded state.

Inherited methods

From com.google.android.material.transformation.ExpandableBehavior
ExpandableWidget
findExpandableWidget(CoordinatorLayout parent, View child)
static T
<T extends ExpandableBehavior> from(View view, Class<T> klass)

A utility function to get the ExpandableBehavior attached to the view.

abstract boolean
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
boolean
onDependentViewChanged(
    CoordinatorLayout parent,
    View child,
    View dependency
)
boolean
onLayoutChild(CoordinatorLayout parent, View child, int layoutDirection)
From com.google.android.material.transformation.ExpandableTransformationBehavior
abstract AnimatorSet
onCreateExpandedStateChangeAnimation(
    View dependency,
    View child,
    boolean expanded,
    boolean isAnimating
)

Creates an AnimatorSet to be played for this expanded state change.

From com.google.android.material.transformation.FabTransformationBehavior
boolean
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
void
onAttachedToLayoutParams(LayoutParams lp)
AnimatorSet
onCreateExpandedStateChangeAnimation(
    View dependency,
    View child,
    boolean expanded,
    boolean isAnimating
)

Creates an AnimatorSet to be played for this expanded state change.

Public constructors

FabTransformationSheetBehavior

public FabTransformationSheetBehavior()

FabTransformationSheetBehavior

public FabTransformationSheetBehavior(Context context, AttributeSet attrs)

Protected methods

onCreateMotionSpec

protected FabTransformationBehavior.FabTransformationSpec onCreateMotionSpec(Context context, boolean expanded)

onExpandedStateChange

protected boolean onExpandedStateChange(
    View dependency,
    View child,
    boolean expanded,
    boolean animated
)

Reacts to a change in expanded state. This callback is guaranteed to be called only once even if setExpanded is called multiple times with the same value. Upon configuration change, this callback is called with animated set to false.

Parameters
View dependency

the com.google.android.material.expandable.ExpandableWidget dependency containing the new expanded state.

View child

the view that should react to the change in expanded state.

boolean expanded

the new expanded state.

boolean animated

true if setExpanded was called, false if restoring from a configuration change.

Returns
boolean

true if the Behavior changed the child view's size or position, false otherwise.