layoutDependsOn

open fun layoutDependsOn(@NonNull parent: @NonNull CoordinatorLayout, @NonNull child: @NonNull V, @NonNull dependency: @NonNull View): Boolean(source)

Determine whether the supplied child view has another specific sibling view as a layout dependency.

This method will be called at least once in response to a layout request. If it returns true for a given child and dependency view pair, the parent CoordinatorLayout will:

  1. Always lay out this child after the dependent child is laid out, regardless of child order.
  2. Call onDependentViewChanged when the dependency view's layout or position changes.

Return

true if child's layout depends on the proposed dependency's layout, false otherwise

Parameters

parent

the parent view of the given child

child

the child view to test

dependency

the proposed dependency of child

See also