Setting behaviour of FloatingActionButton
suggest changeYou can set the behavior of the FAB in XML.
For example:
<android.support.design.widget.FloatingActionButton
app:layout_behavior=".MyBehavior" />
Or you can set it programmatically. fab is the FloatingActionButton, and its parent must be a CoordinatorLayout for this cast. MyBehavior is not defined in this snippet.
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
p.setBehavior(new MyBehavior());
fab.setLayoutParams(p);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents