Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. /**
  2. * Determine whether the supplied child view has another specific sibling view as a
  3. * layout dependency.
  4. *
  5. * <p>This method will be called at least once in response to a layout request. If it
  6. * returns true for a given child and dependency view pair, the parent CoordinatorLayout
  7. * will:</p>
  8. * <ol>
  9. * <li>Always lay out this child after the dependent child is laid out, regardless
  10. * of child order.</li>
  11. * <li>Call {@link #onDependentViewChanged} when the dependency view's layout or
  12. * position changes.</li>
  13. * </ol>
  14. *
  15. * @param parent the parent view of the given child
  16. * @param child the child view to test
  17. * @param dependency the proposed dependency of child
  18. * @return true if child's layout depends on the proposed dependency's layout,
  19. * false otherwise
  20. *
  21. * @see #onDependentViewChanged(CoordinatorLayout, android.view.View, android.view.View)
  22. */
  23. public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) {
  24. return false;
  25. }
  26.  
  27. /**
  28. * Respond to a change in a child's dependent view
  29. *
  30. * <p>This method is called whenever a dependent view changes in size or position outside
  31. * of the standard layout flow. A Behavior may use this method to appropriately update
  32. * the child view in response.</p>
  33. *
  34. * <p>A view's dependency is determined by
  35. * {@link #layoutDependsOn(CoordinatorLayout, android.view.View, android.view.View)} or
  36. * if {@code child} has set another view as it's anchor.</p>
  37. *
  38. * <p>Note that if a Behavior changes the layout of a child via this method, it should
  39. * also be able to reconstruct the correct position in
  40. * {@link #onLayoutChild(CoordinatorLayout, android.view.View, int) onLayoutChild}.
  41. * <code>onDependentViewChanged</code> will not be called during normal layout since
  42. * the layout of each child view will always happen in dependency order.</p>
  43. *
  44. * <p>If the Behavior changes the child view's size or position, it should return true.
  45. * The default implementation returns false.</p>
  46. *
  47. * @param parent the parent view of the given child
  48. * @param child the child view to manipulate
  49. * @param dependency the dependent view that changed
  50. * @return true if the Behavior changed the child view's size or position, false otherwise
  51. */
  52. public boolean onDependentViewChanged(CoordinatorLayout parent, V child, View dependency) {
  53. return false;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement