ExpandableTransformationBehavior

public abstract class ExpandableTransformationBehavior
extends ExpandableBehavior

java.lang.Object
   ↳ android.support.design.widget.CoordinatorLayout.Behavior<android.view.View>
     ↳ com.google.android.material.transformation.ExpandableBehavior
       ↳ com.google.android.material.transformation.ExpandableTransformationBehavior
Known Direct Subclasses
Known Indirect Subclasses


Base Behavior for views that can react to an ExpandableWidget's setExpanded(boolean) state changes by transforming the ExpandableWidget into itself.

Behaviors should override onCreateExpandedStateChangeAnimation(View, View, boolean, boolean) to return an animation

Summary

Public constructors

ExpandableTransformationBehavior()
ExpandableTransformationBehavior(Context context, AttributeSet attrs)

Protected methods

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

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

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

Reacts to a change in expanded state.

Inherited methods

From class com.google.android.material.transformation.ExpandableBehavior
From class android.support.design.widget.CoordinatorLayout.Behavior
From class java.lang.Object

Public constructors

ExpandableTransformationBehavior

ExpandableTransformationBehavior ()

ExpandableTransformationBehavior

ExpandableTransformationBehavior (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Protected methods

onCreateExpandedStateChangeAnimation

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
dependency View: the ExpandableWidget dependency containing the new expanded state.

child View: the view that should react to the change in expanded state.

expanded boolean: the new expanded state.

isAnimating boolean: whether this state change occurred while a previous state change was still

Returns
AnimatorSet

onExpandedStateChange

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(boolean) is called multiple times with the same value. Upon configuration change, this callback is called with animated set to false.

Parameters
dependency View: the ExpandableWidget dependency containing the new expanded state.

child View: the view that should react to the change in expanded state.

expanded boolean: the new expanded state.

animated boolean: true if setExpanded(boolean) 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.