onDependentViewChanged

open fun onDependentViewChanged(parent: CoordinatorLayout, child: TextView, dependency: View): Boolean(source)

Respond to a change in a child's dependent view

This method is called whenever a dependent view changes in size or position outside of the standard layout flow. A Behavior may use this method to appropriately update the child view in response.

A view's dependency is determined by layoutDependsOn or if child has set another view as it's anchor.

Note that if a Behavior changes the layout of a child via this method, it should also be able to reconstruct the correct position in onLayoutChild. onDependentViewChanged will not be called during normal layout since the layout of each child view will always happen in dependency order.

If the Behavior changes the child view's size or position, it should return true. The default implementation returns false.

Return

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

Parameters

parent

the parent view of the given child

child

the child view to manipulate

dependency

the dependent view that changed