Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Determine whether the supplied child view has another specific sibling view as a
- * layout dependency.
- *
- * <p>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:</p>
- * <ol>
- * <li>Always lay out this child after the dependent child is laid out, regardless
- * of child order.</li>
- * <li>Call {@link #onDependentViewChanged} when the dependency view's layout or
- * position changes.</li>
- * </ol>
- *
- * @param parent the parent view of the given child
- * @param child the child view to test
- * @param dependency the proposed dependency of child
- * @return true if child's layout depends on the proposed dependency's layout,
- * false otherwise
- *
- * @see #onDependentViewChanged(CoordinatorLayout, android.view.View, android.view.View)
- */
- public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) {
- return false;
- }
- /**
- * Respond to a change in a child's dependent view
- *
- * <p>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.</p>
- *
- * <p>A view's dependency is determined by
- * {@link #layoutDependsOn(CoordinatorLayout, android.view.View, android.view.View)} or
- * if {@code child} has set another view as it's anchor.</p>
- *
- * <p>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
- * {@link #onLayoutChild(CoordinatorLayout, android.view.View, int) onLayoutChild}.
- * <code>onDependentViewChanged</code> will not be called during normal layout since
- * the layout of each child view will always happen in dependency order.</p>
- *
- * <p>If the Behavior changes the child view's size or position, it should return true.
- * The default implementation returns false.</p>
- *
- * @param parent the parent view of the given child
- * @param child the child view to manipulate
- * @param dependency the dependent view that changed
- * @return true if the Behavior changed the child view's size or position, false otherwise
- */
- public boolean onDependentViewChanged(CoordinatorLayout parent, V child, View dependency) {
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement