FabTransformationScrimBehavior

public class FabTransformationScrimBehavior extends ExpandableTransformationBehavior


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

Summary

Constants

static final long
static final long
static final long
static final long

Public constructors

FabTransformationScrimBehavior(Context context, AttributeSet attrs)

Public methods

boolean
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
boolean
onTouchEvent(CoordinatorLayout parent, View child, MotionEvent ev)

Protected methods

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

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

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.

Constants

COLLAPSE_DELAY

public static final long COLLAPSE_DELAY = 0

COLLAPSE_DURATION

public static final long COLLAPSE_DURATION = 150

EXPAND_DELAY

public static final long EXPAND_DELAY = 75

EXPAND_DURATION

public static final long EXPAND_DURATION = 150

Public constructors

FabTransformationScrimBehavior

public FabTransformationScrimBehavior()

FabTransformationScrimBehavior

public FabTransformationScrimBehavior(Context context, AttributeSet attrs)

Public methods

layoutDependsOn

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

onTouchEvent

public boolean onTouchEvent(CoordinatorLayout parent, View child, MotionEvent ev)

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