ExpandableBehavior
public
abstract
class
ExpandableBehavior
extends Behavior<View>
java.lang.Object | ||
↳ | androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<android.view.View> | |
↳ | com.google.android.material.transformation.ExpandableBehavior |
![]() |
![]() |
This class is deprecated.
Use MaterialContainerTransform
instead.
Base Behavior for views that can react to an ExpandableWidget
's setExpanded(boolean)
state changes.
Summary
Public constructors | |
---|---|
ExpandableBehavior()
|
|
ExpandableBehavior(Context context, AttributeSet attrs)
|
Public methods | |
---|---|
static
<T extends ExpandableBehavior>
T
|
from(View view, Class<T> klass)
A utility function to get the |
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)
|
Protected methods | |
---|---|
ExpandableWidget
|
findExpandableWidget(CoordinatorLayout parent, View child)
|
abstract
boolean
|
onExpandedStateChange(View dependency, View child, boolean expanded, boolean animated)
Reacts to a change in expanded state. |
Inherited methods | |
---|---|
![]()
androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
| |
![]()
java.lang.Object
|
Public constructors
ExpandableBehavior
ExpandableBehavior ()
ExpandableBehavior
ExpandableBehavior (Context context, AttributeSet attrs)
Parameters | |
---|---|
context |
Context |
attrs |
AttributeSet |
Public methods
from
T from (View view, Class<T> klass)
A utility function to get the ExpandableBehavior
attached to the view
.
Parameters | |
---|---|
view |
View : The View that the ExpandableBehavior is attached to. |
klass |
Class : The expected Class of the attached ExpandableBehavior . |
Returns | |
---|---|
T |
The ExpandableBehavior attached to the view .
|
layoutDependsOn
boolean layoutDependsOn (CoordinatorLayout parent, View child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
dependency |
View |
Returns | |
---|---|
boolean |
onDependentViewChanged
boolean onDependentViewChanged (CoordinatorLayout parent, View child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
dependency |
View |
Returns | |
---|---|
boolean |
onLayoutChild
boolean onLayoutChild (CoordinatorLayout parent, View child, int layoutDirection)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
layoutDirection |
int |
Returns | |
---|---|
boolean |
Protected methods
findExpandableWidget
ExpandableWidget findExpandableWidget (CoordinatorLayout parent, View child)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
Returns | |
---|---|
ExpandableWidget |
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. |