Tutorial by Examples

To create a Behavior just extend the CoordinatorLayout.Behavior class. Extend the CoordinatorLayout.Behavior Example: public class MyBehavior<V extends View> extends CoordinatorLayout.Behavior<V> { /** * Default constructor. */ public MyBehavior() { ...
The SwipeDismissBehavior works on any View and implements the functionality of swipe to dismiss in our layouts with a CoordinatorLayout. Just use: final SwipeDismissBehavior<MyView> swipe = new SwipeDismissBehavior(); //Sets the swipe direction for this behavior. ...
You can use the CoordinatorLayout.Behavior to create dependencies between views. You can anchor a View to another View by: using the layout_anchor attribute. creating a custom Behavior and implementing the layoutDependsOn method returning true. For example, in order to create a Behavior for m...

Page 1 of 1