]> git.ktnx.net Git - mobile-ledger.git/commitdiff
add transparent primary variant and use it for the divider gradient in the navigation...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 Feb 2019 19:39:28 +0000 (21:39 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 Feb 2019 19:39:28 +0000 (21:39 +0200)
the default android transparent is "black" and it shows in gradients

app/src/main/res/drawable-anydpi-v21/list_divider.xml
app/src/main/res/values/attr.xml
app/src/main/res/values/styles.xml
tools/gen-styles

index dafd9e119329a7e913e189203044d5e8578e1710..b227f6721ff904814af3fd2fc6a10610b6dfb8ef 100644 (file)
@@ -19,8 +19,8 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <gradient
         android:type="linear"
-        android:startColor="@android:color/transparent"
+        android:endColor="?colorPrimaryTransparent"
         android:centerColor="?colorPrimary"
-        android:endColor="@android:color/transparent"/>
+        android:startColor="?colorPrimaryTransparent" />
     <size android:height="2dp" />
 </shape>
\ No newline at end of file
index f2032412f4a1afe12ab9696c5e82dd069e627824..70b100f80eef176ec14afd0650cd5d5efefd20a1 100644 (file)
@@ -4,5 +4,6 @@
     <attr name="table_row_dark_bg" format="reference|color"/>
     <attr name="table_row_light_bg" format="reference|color"/>
     <attr name="textColor" format="reference|color"/>
+    <attr name="colorPrimaryTransparent" format="reference|color" />
 
 </resources>
\ No newline at end of file
index 857b681adf114e1d126fbd46070338f5e0ba5696..cdc6d5a0c90552c0fa002d22c50810790c3a594b 100644 (file)
@@ -32,8 +32,9 @@
     <style name="AppTheme.NoActionBar">
         <item name="windowActionBar">false</item>
         <item name="windowNoTitle">true</item>
-        <item name="textColor">@android:color/tab_indicator_text</item>
+        <item name="textColor">#d0000000</item>
         <item name="colorPrimary">#875cd6</item>
+        <item name="colorPrimaryTransparent">#00875cd6</item>
         <item name="colorAccent">#6013ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#efe7fd</item>
@@ -41,6 +42,7 @@
     </style>
     <style name="AppTheme.NoActionBar.0" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d65c5c</item>
+        <item name="colorPrimaryTransparent">#00d65c5c</item>
         <item name="colorAccent">#ec1313</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fde7e7</item>
@@ -48,6 +50,7 @@
     </style>
     <style name="AppTheme.NoActionBar.15" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d67a5c</item>
+        <item name="colorPrimaryTransparent">#00d67a5c</item>
         <item name="colorAccent">#ec4913</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fdede7</item>
@@ -55,6 +58,7 @@
     </style>
     <style name="AppTheme.NoActionBar.30" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d6995c</item>
+        <item name="colorPrimaryTransparent">#00d6995c</item>
         <item name="colorAccent">#ec8013</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fdf2e7</item>
@@ -62,6 +66,7 @@
     </style>
     <style name="AppTheme.NoActionBar.45" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d6b85c</item>
+        <item name="colorPrimaryTransparent">#00d6b85c</item>
         <item name="colorAccent">#ecb613</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fdf8e7</item>
@@ -69,6 +74,7 @@
     </style>
     <style name="AppTheme.NoActionBar.60" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d6d65c</item>
+        <item name="colorPrimaryTransparent">#00d6d65c</item>
         <item name="colorAccent">#ecec13</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fdfde7</item>
@@ -76,6 +82,7 @@
     </style>
     <style name="AppTheme.NoActionBar.75" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#b8d65c</item>
+        <item name="colorPrimaryTransparent">#00b8d65c</item>
         <item name="colorAccent">#b6ec13</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#f8fde7</item>
@@ -83,6 +90,7 @@
     </style>
     <style name="AppTheme.NoActionBar.90" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#99d65c</item>
+        <item name="colorPrimaryTransparent">#0099d65c</item>
         <item name="colorAccent">#80ec13</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#f2fde7</item>
@@ -90,6 +98,7 @@
     </style>
     <style name="AppTheme.NoActionBar.105" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#7ad65c</item>
+        <item name="colorPrimaryTransparent">#007ad65c</item>
         <item name="colorAccent">#49ec13</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#edfde7</item>
     </style>
     <style name="AppTheme.NoActionBar.120" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cd65c</item>
+        <item name="colorPrimaryTransparent">#005cd65c</item>
         <item name="colorAccent">#13ec13</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7fde7</item>
     </style>
     <style name="AppTheme.NoActionBar.135" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cd67a</item>
+        <item name="colorPrimaryTransparent">#005cd67a</item>
         <item name="colorAccent">#13ec49</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7fded</item>
     </style>
     <style name="AppTheme.NoActionBar.150" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cd699</item>
+        <item name="colorPrimaryTransparent">#005cd699</item>
         <item name="colorAccent">#13ec80</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7fdf2</item>
     </style>
     <style name="AppTheme.NoActionBar.165" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cd6b8</item>
+        <item name="colorPrimaryTransparent">#005cd6b8</item>
         <item name="colorAccent">#13ecb6</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7fdf8</item>
     </style>
     <style name="AppTheme.NoActionBar.180" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cd6d6</item>
+        <item name="colorPrimaryTransparent">#005cd6d6</item>
         <item name="colorAccent">#13ecec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7fdfd</item>
     </style>
     <style name="AppTheme.NoActionBar.195" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5cb8d6</item>
+        <item name="colorPrimaryTransparent">#005cb8d6</item>
         <item name="colorAccent">#13b6ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7f8fd</item>
     </style>
     <style name="AppTheme.NoActionBar.210" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5c99d6</item>
+        <item name="colorPrimaryTransparent">#005c99d6</item>
         <item name="colorAccent">#1380ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7f2fd</item>
     </style>
     <style name="AppTheme.NoActionBar.225" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5c7ad6</item>
+        <item name="colorPrimaryTransparent">#005c7ad6</item>
         <item name="colorAccent">#1349ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7edfd</item>
     </style>
     <style name="AppTheme.NoActionBar.240" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#5c5cd6</item>
+        <item name="colorPrimaryTransparent">#005c5cd6</item>
         <item name="colorAccent">#1313ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#e7e7fd</item>
     </style>
     <style name="AppTheme.NoActionBar.255" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#7a5cd6</item>
+        <item name="colorPrimaryTransparent">#007a5cd6</item>
         <item name="colorAccent">#4913ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#ede7fd</item>
     </style>
     <style name="AppTheme.NoActionBar.270" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#995cd6</item>
+        <item name="colorPrimaryTransparent">#00995cd6</item>
         <item name="colorAccent">#8013ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#f2e7fd</item>
     </style>
     <style name="AppTheme.NoActionBar.285" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#b85cd6</item>
+        <item name="colorPrimaryTransparent">#00b85cd6</item>
         <item name="colorAccent">#b613ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#f8e7fd</item>
     </style>
     <style name="AppTheme.NoActionBar.300" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d65cd6</item>
+        <item name="colorPrimaryTransparent">#00d65cd6</item>
         <item name="colorAccent">#ec13ec</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fde7fd</item>
     </style>
     <style name="AppTheme.NoActionBar.315" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d65cb8</item>
+        <item name="colorPrimaryTransparent">#00d65cb8</item>
         <item name="colorAccent">#ec13b6</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fde7f8</item>
     </style>
     <style name="AppTheme.NoActionBar.330" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d65c99</item>
+        <item name="colorPrimaryTransparent">#00d65c99</item>
         <item name="colorAccent">#ec1380</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fde7f2</item>
     </style>
     <style name="AppTheme.NoActionBar.345" parent="AppTheme.NoActionBar">
         <item name="colorPrimary">#d65c7a</item>
+        <item name="colorPrimaryTransparent">#00d65c7a</item>
         <item name="colorAccent">#ec1349</item>
         <item name="drawer_background">#ffffffff</item>
         <item name="table_row_dark_bg">#fde7ed</item>
index f4aecdfe7dc789e1b025bad75a5e748796151837..a86983b764729bf9791d0c63cd5e8e916640b29c 100644 (file)
@@ -155,6 +155,8 @@ sub hslStyleForHue {
        }
        printf "  <item name=\"colorPrimary\">#%s</item>\n",
                        hslHex($hue/360.0, 0.60, 0.60);
+       printf "  <item name=\"colorPrimaryTransparent\">#00%s</item>\n",
+                       hslHex($hue/360.0, 0.60, 0.60);
        printf "  <item name=\"colorAccent\">#%s</item>\n",
                        hslHex($hue/360.0, 0.85, 0.50);
        printf "  <item name=\"drawer_background\">#ffffffff</item>\n";