summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-15 17:36:51 +0100
committercyBerta <cyberta@riseup.net>2021-11-15 17:36:51 +0100
commit31ef0e2a1b39a2aaa9e8b43609f6786e31e44eeb (patch)
treec041aec261d6af561ab27ee1925e77229a6a6b51 /app
parentd5faac5ac7937c5a7f19c9a409e2a1376afc50aa (diff)
improve location button layout with rounded corners, gradient and shadow
Diffstat (limited to 'app')
-rw-r--r--app/src/main/res/drawable/cust_button_primary_rect.xml82
-rw-r--r--app/src/main/res/values/colors.xml2
2 files changed, 72 insertions, 12 deletions
diff --git a/app/src/main/res/drawable/cust_button_primary_rect.xml b/app/src/main/res/drawable/cust_button_primary_rect.xml
index 93be5c18..cb77b578 100644
--- a/app/src/main/res/drawable/cust_button_primary_rect.xml
+++ b/app/src/main/res/drawable/cust_button_primary_rect.xml
@@ -1,21 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" >
- <shape android:shape="rectangle" >
- <padding android:left="8dp" android:right="8dp"/>
- <solid android:color="@color/colorPrimaryDark"/>
- </shape>
+ <layer-list
+ android:paddingLeft="@dimen/button_bevel"
+ android:paddingRight="@dimen/button_bevel">
+ <item>
+ <shape android:shape="rectangle">
+ <solid android:color="@color/colorPrimaryDark"/>
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="rectangle">
+ <solid android:color="@color/black_transparent"/>
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+ </layer-list>
</item>
<item android:state_focused="true">
- <shape android:shape="rectangle" >
- <padding android:left="8dp" android:right="8dp"/>
- <solid android:color="@color/colorPrimaryDark"/>
- </shape>
+ <layer-list
+ android:paddingLeft="@dimen/button_bevel"
+ android:paddingRight="@dimen/button_bevel">
+ <item>
+ <shape android:shape="rectangle" >
+ <solid android:color="@color/colorPrimaryDark"/>
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="rectangle">
+ <solid android:color="@color/black_transparent"/>
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+
+ </layer-list>
</item>
<item >
- <shape android:shape="rectangle" >
- <padding android:left="8dp" android:right="8dp"/>
- <solid android:color="@color/colorPrimary"/>
- </shape>
+ <layer-list
+ android:paddingLeft="@dimen/button_bevel"
+ android:paddingRight="@dimen/button_bevel">
+ <!-- shadow -->
+ <item
+ android:top="@dimen/button_bevel"
+ android:left="1dp"
+ >
+ <shape android:shape="rectangle" >
+ <corners android:radius="10dp" />
+ <solid android:color="@color/colorPrimary_transparent"/>
+ </shape>
+ </item>
+ <!-- fill -->
+ <item
+ android:bottom="@dimen/button_bevel"
+ android:right="1dp"
+ >
+ <shape android:shape="rectangle" >
+ <solid android:color="@color/colorPrimary"/>
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+ <!-- gradient -->
+ <item
+ android:bottom="@dimen/button_bevel"
+ android:right="1dp"
+ >
+ <shape android:shape="rectangle">
+ <gradient android:startColor="@color/black_transparent"
+ android:endColor="@color/white_transparent"
+ android:angle="90"
+ />
+ <corners android:radius="@dimen/stdpadding"/>
+ </shape>
+ </item>
+ </layer-list>
</item>
</selector> \ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index bba7f1b5..f1da0785 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -33,6 +33,8 @@
<color name="deepOrange200">#ffab91</color>
<color name="white">#ffffff</color>
+ <color name="white_transparent">#20ffffff</color>
+ <color name="black_transparent">#20000000</color>
<color name="colorActionBarTitleFont">@color/white</color>
<color name="colorActionBarSubtitleFont">@color/black800</color>