onLayoutChild

open fun onLayoutChild(@NonNull parent: @NonNull CoordinatorLayout, @NonNull child: @NonNull V, layoutDirection: Int): Boolean(source)

Called when the parent CoordinatorLayout is about the lay out the given child view.

This method can be used to perform custom or modified layout of a child view in place of the default child layout behavior. The Behavior's implementation can delegate to the standard CoordinatorLayout measurement behavior by calling parent.onLayoutChild.

If a Behavior implements onDependentViewChanged to change the position of a view in response to a dependent view changing, it should also implement onLayoutChild in such a way that respects those dependent views. onLayoutChild will always be called for a dependent view after its dependency has been laid out.

Return

true if the Behavior performed layout of the child view, false to request default layout behavior

Parameters

parent

the parent CoordinatorLayout

child

child view to lay out

layoutDirection

the resolved layout direction for the CoordinatorLayout, such as LAYOUT_DIRECTION_LTR or LAYOUT_DIRECTION_RTL.