diff options
-rw-r--r-- | OpenKeychain/src/main/res/drawable/fab_label_background.xml | 11 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/layout/key_list_fragment.xml | 113 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/values/colors.xml | 10 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/values/styles.xml | 5 |
4 files changed, 104 insertions, 35 deletions
diff --git a/OpenKeychain/src/main/res/drawable/fab_label_background.xml b/OpenKeychain/src/main/res/drawable/fab_label_background.xml new file mode 100644 index 000000000..0d8c05b11 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable/fab_label_background.xml @@ -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>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/key_list_fragment.xml b/OpenKeychain/src/main/res/layout/key_list_fragment.xml index 6529a88e0..2c4ab909e 100644 --- a/OpenKeychain/src/main/res/layout/key_list_fragment.xml +++ b/OpenKeychain/src/main/res/layout/key_list_fragment.xml @@ -1,41 +1,84 @@ <?xml version="1.0" encoding="utf-8"?> -<org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/key_list_swipe_container" - android:layout_width="match_parent" +<RelativeLayout xmlns:fab="http://schemas.android.com/apk/res-auto" + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" - android:orientation="vertical"> - <!--rebuild functionality of ListFragment --> - <FrameLayout - android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_width="match_parent"> - <se.emilsjolander.stickylistheaders.StickyListHeadersListView - android:id="@+id/key_list_list" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:clipToPadding="false" - android:drawSelectorOnTop="true" - android:fastScrollEnabled="true" - android:paddingBottom="16dp" - android:paddingLeft="16dp" - android:paddingRight="32dp" - android:scrollbarStyle="outsideOverlay" /> - - <LinearLayout - android:id="@+id/key_list_empty" + <org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/key_list_swipe_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + <!--rebuild functionality of ListFragment --> + <FrameLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" - android:orientation="vertical" - android:visibility="visible"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent"> + + <se.emilsjolander.stickylistheaders.StickyListHeadersListView + android:id="@+id/key_list_list" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipToPadding="false" + android:drawSelectorOnTop="true" + android:fastScrollEnabled="true" + android:paddingBottom="16dp" + android:paddingLeft="16dp" + android:paddingRight="32dp" + android:scrollbarStyle="outsideOverlay" /> + + <LinearLayout + android:id="@+id/key_list_empty" + android:layout_width="match_parent" + android:layout_height="match_parent" android:gravity="center" - android:text="@string/key_list_empty_text1" - android:textAppearance="?android:attr/textAppearanceLarge" /> + android:orientation="vertical" + android:visibility="visible"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:text="@string/key_list_empty_text1" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + </LinearLayout> + </FrameLayout> + </org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout> + + <com.getbase.floatingactionbutton.FloatingActionsMenu + android:id="@+id/fab_main" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" + android:layout_alignParentBottom="true" + fab:fab_addButtonColorNormal="@color/fab" + fab:fab_addButtonColorPressed="@color/fab_pressed" + fab:fab_addButtonSize="normal" + fab:fab_addButtonPlusIconColor="@color/icons" + fab:fab_expandDirection="up" + fab:fab_labelStyle="@style/FabMenuStyle" + android:layout_marginBottom="16dp" + android:layout_marginRight="16dp" + android:layout_marginEnd="16dp"> + + <com.getbase.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_add_cloud" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + fab:fab_colorNormal="@color/fab" + fab:fab_colorPressed="@color/fab_pressed" + fab:fab_title="Scan QR Code" + fab:fab_size="mini" /> + + <com.getbase.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_add_qr_code" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + fab:fab_colorNormal="@color/fab" + fab:fab_colorPressed="@color/fab_pressed" + fab:fab_title="Search Cloud" + fab:fab_size="mini" /> - </LinearLayout> - </FrameLayout> -</org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout>
\ No newline at end of file + </com.getbase.floatingactionbutton.FloatingActionsMenu> +</RelativeLayout>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/colors.xml b/OpenKeychain/src/main/res/values/colors.xml index 48fe11798..4bce321ec 100644 --- a/OpenKeychain/src/main/res/values/colors.xml +++ b/OpenKeychain/src/main/res/values/colors.xml @@ -38,6 +38,16 @@ <color name="holo_gray_light">#33999999</color> <color name="holo_gray_bright">#33CCCCCC</color> + + <!-- FAB --> + <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> + <!-- http://www.google.com/design/spec/style/color.html#color-color-palette light = normal color diff --git a/OpenKeychain/src/main/res/values/styles.xml b/OpenKeychain/src/main/res/values/styles.xml index 3844ccb29..03ccce85e 100644 --- a/OpenKeychain/src/main/res/values/styles.xml +++ b/OpenKeychain/src/main/res/values/styles.xml @@ -34,4 +34,9 @@ <item name="android:background">@drawable/selector_transparent_button</item> </style> + <style name="FabMenuStyle"> + <item name="android:background">@drawable/fab_label_background</item> + <item name="android:textColor">@color/white</item> + </style> + </resources>
\ No newline at end of file |