FabTransformationBehavior

public abstract class FabTransformationBehavior extends ExpandableTransformationBehavior


Abstract base behavior for any non-scrim view that should appear when a is setExpanded expanded}.

Summary

Nested types

Motion spec for a FAB transformation.

Public constructors

FabTransformationBehavior(Context context, AttributeSet attrs)

Public methods

boolean
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
void
onAttachedToLayoutParams(LayoutParams lp)

Protected methods

AnimatorSet
onCreateExpandedStateChangeAnimation(
    View dependency,
    View child,
    boolean expanded,
    boolean isAnimating
)

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

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

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.

boolean
onDependentViewChanged(
    CoordinatorLayout parent,
    View child,
    View dependency
)
boolean
onLayoutChild(CoordinatorLayout parent, View child, int layoutDirection)
From com.google.android.material.transformation.ExpandableTransformationBehavior
boolean
onExpandedStateChange(
    View dependency,
    View child,
    boolean expanded,
    boolean animated
)

Reacts to a change in expanded state.

Public constructors

FabTransformationBehavior

public FabTransformationBehavior()

FabTransformationBehavior

public FabTransformationBehavior(Context context, AttributeSet attrs)

Public methods

layoutDependsOn

public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency)

onAttachedToLayoutParams

public void onAttachedToLayoutParams(LayoutParams lp)

Protected methods

onCreateExpandedStateChangeAnimation

protected AnimatorSet onCreateExpandedStateChangeAnimation(
    View dependency,
    View child,
    boolean expanded,
    boolean isAnimating
)

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

If the new expanded state is true, the dependency should be hidden and the child should be shown.

If the new expanded state is false, the dependency should be shown and the child should be hidden.

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 isAnimating

whether this state change occurred while a previous state change was still

onCreateMotionSpec

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