android - FloatingActionButton with Multiple Actions -


i'm using floatingactionsbutton (fab) design support library (com.android.support:design:22.2.0).

in application have 2 main functionalities first sync data every x minutes (which starts service , updates data every x minutes) , second sync once (which request data server , updates ui).

i want use fab these main functionalities , wondering , how can make it:

the first approach using 1 fab when clicked button show 2 new fabs 1 each functionality.

the second approach displaying 2 fabs in ui sync every x minutes fab bigger update once fab.

i interesting in first approach , wondering how can implement behaviour? looked around view new , couldn't find example.

thanks.

i using github library, simple , solved problems:

https://github.com/clans/floatingactionbutton

add dependency build.gradle:

dependencies {     compile 'com.github.clans:fab:1.6.4' } 

add beginning of xml:

xmlns:fab="http://schemas.android.com/apk/res-auto" 

now add buttons, example:

<com.github.clans.fab.floatingactionmenu     android:id="@+id/floatingmenu"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_alignparentbottom="true"     android:layout_alignparentright="true"     fab:menu_labels_ellipsize="end"     fab:menu_labels_singleline="true"     fab:menu_fab_label="cancel"     fab:menu_backgroundcolor="#ccffffff"     fab:menu_animationdelayperitem="0"     fab:menu_colornormal="#00c29f"     fab:menu_colorpressed="#00c29f"     fab:menu_colorripple="#00c29f"     android:padding="8dp">      <com.github.clans.fab.floatingactionbutton         android:id="@+id/fabedit"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/ic_edit_white"         fab:fab_size="mini"         fab:fab_label="edit category"/>      <com.github.clans.fab.floatingactionbutton         android:id="@+id/fabaddproduct"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/fab_add"         fab:fab_size="mini"         fab:fab_label="add product"/>      <com.github.clans.fab.floatingactionbutton         android:id="@+id/fabaddsubcategory"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/fab_add"         fab:fab_size="mini"         fab:fab_label="subcategory"/>  </com.github.clans.fab.floatingactionmenu> 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -