Try menu-deploying fab.

This commit is contained in:
kenkeiras 2017-07-09 15:49:52 -04:00
parent 1f5f9cb8de
commit cd6b7c87d6
7 changed files with 90 additions and 12 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/black_semi_transparent"/>
<padding
android:left="16dp"
android:top="4dp"
android:right="16dp"
android:bottom="4dp"/>
<corners
android:radius="2dp"/>
</shape>

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.codigoparallevar.minicards.MainActivity">
@ -27,14 +29,41 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- include layout="@layout/content_main" / -->
<android.support.design.widget.FloatingActionButton
<com.getbase.floatingactionbutton.FloatingActionsMenu
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
fab:fab_addButtonColorNormal="@color/white"
fab:fab_addButtonColorPressed="@color/white_pressed"
fab:fab_addButtonPlusIconColor="@color/half_black"
fab:fab_addButtonSize="mini"
fab:fab_labelStyle="@style/menu_labels_style"
fab:fab_labelsPosition="left">
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/set_developer_mode_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_colorNormal="@color/white"
fab:fab_title="TBI: change to develop mode"
fab:fab_colorPressed="@color/white_pressed"/>
<com.getbase.floatingactionbutton.AddFloatingActionButton
android:id="@+id/add_part_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_plusIconColor="@color/half_black"
fab:fab_colorNormal="@color/white"
fab:fab_title="Add new part"
fab:fab_colorPressed="@color/white_pressed"/>
</com.getbase.floatingactionbutton.FloatingActionsMenu>
</android.support.design.widget.CoordinatorLayout>

View file

@ -3,4 +3,14 @@
<color name="colorPrimary">#066996</color>
<color name="colorPrimaryDark">#044563</color>
<color name="colorAccent">#b2ff59</color>
<color name="black_semi_transparent">#B2000000</color>
<color name="background">#e5e5e5</color>
<color name="half_black">#808080</color>
<color name="white">#fafafa</color>
<color name="white_pressed">#f1f1f1</color>
<color name="pink">#e91e63</color>
<color name="pink_pressed">#ec407a</color>
<color name="blue_semi_transparent">#805677fc</color>
<color name="blue_semi_transparent_pressed">#80738ffe</color>
</resources>

View file

@ -8,4 +8,9 @@
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="menu_labels_style">
<item name="android:background">@drawable/fab_label_background</item>
<item name="android:textColor">@color/white</item>
</style>
</resources>