Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,41 @@
&lt;/m:MaterialFAB><br/>
</demo:PrettyPre>


<m:MaterialTitle title="FAB Java code example"/>

<demo:PrettyPre addStyleNames="lang-xml z-depth-1">
public class Fab extends Composite {
public Fab() {
MaterialFAB fab = new MaterialFAB();
// initial button to be initially displayed
MaterialButton btnInitial = new MaterialButton();
btnInitial.setIconType(IconType.ADD);
btnInitial.setType(ButtonType.FLOATING);
btnInitial.setSize(ButtonSize.LARGE);
btnInitial.setBackgroundColor("red");
fab.add(btnInitial);
// Fab list will hide all buttons attached on it
MaterialFABList fabList = new MaterialFABList();
// Item 1
MaterialButton btnItem1 = new MaterialButton();
btnItem1.setType(ButtonType.FLOATING);
btnItem1.setIconType(IconType.ACCESS_ALARMS);
btnItem1.setBackgroundColor("blue");
fabList.add(btnItem1);
// Item 2
MaterialButton btnItem2 = new MaterialButton();
btnItem2.setType(ButtonType.FLOATING);
btnItem2.setIconType(IconType.AC_UNIT);
btnItem2.setBackgroundColor("purple");
fabList.add(btnItem2);
fab.add(fabList);

initWidget(fab);
}
</demo:PrettyPre>
And then in Your view use just:
`widget.add(new Fab());`

</g:HTMLPanel>
</ui:UiBinder>