浮动操作按钮模板
Floating action button template
我注意到 Messenger、hangout 和其他应用程序都使用了此模板。我怎样才能达到相同的结果?
我使用了一个库来获取这些布局。这是我使用的代码的一部分。有关图书馆的更多信息,请转到此 link.https://github.com/Clans/FloatingActionButton
myxml.xml
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/menu_red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
htext:menu_labels_ellipsize="end"
htext:menu_labels_singleLine="true"
htext:menu_backgroundColor="#ccffffff"
>
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabphy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Physics" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabche"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Chemistry" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabmat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Maths" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabgk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load GK" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabsd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/stat_notify_sdcard"
htext:fab_size="mini"
htext:fab_label="Load SD Card" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_search"
htext:fab_size="mini"
htext:fab_label="Change folder" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_input_add"
htext:fab_size="mini"
android:visibility="gone"
htext:fab_label="Add file" />
</com.github.clans.fab.FloatingActionMenu>
你需要定制它
<uk.co.markormesher.android_fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
我注意到 Messenger、hangout 和其他应用程序都使用了此模板。我怎样才能达到相同的结果?
我使用了一个库来获取这些布局。这是我使用的代码的一部分。有关图书馆的更多信息,请转到此 link.https://github.com/Clans/FloatingActionButton
myxml.xml
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/menu_red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
htext:menu_labels_ellipsize="end"
htext:menu_labels_singleLine="true"
htext:menu_backgroundColor="#ccffffff"
>
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabphy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Physics" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabche"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Chemistry" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabmat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load Maths" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabgk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star_big_on"
android:visibility="gone"
htext:fab_size="mini"
htext:fab_label="Load GK" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fabsd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/stat_notify_sdcard"
htext:fab_size="mini"
htext:fab_label="Load SD Card" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_search"
htext:fab_size="mini"
htext:fab_label="Change folder" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/fab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_input_add"
htext:fab_size="mini"
android:visibility="gone"
htext:fab_label="Add file" />
</com.github.clans.fab.FloatingActionMenu>
你需要定制它
<uk.co.markormesher.android_fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="match_parent"
android:layout_height="match_parent"/>