[Android] Audio : Use gradient transparent color for the headers

Alexandre Perraud git at videolan.org
Thu Mar 28 14:28:54 CET 2019


vlc-android | branch: 3.1.x | Alexandre Perraud <4leyx4ndre at gmail.com> | Wed Mar 20 16:23:55 2019 +0100| [de51268298e5bc721480497acdd9e3d54b92015c] | committer: Geoffrey Métais

Audio : Use gradient transparent color for the headers

> https://code.videolan.org/videolan/vlc-android/commit/de51268298e5bc721480497acdd9e3d54b92015c
---

 vlc-android/res/drawable/gradient_background_dark.xml  | 9 +++++++++
 vlc-android/res/drawable/gradient_background_light.xml | 9 +++++++++
 vlc-android/res/layout/recycler_section_header.xml     | 2 +-
 vlc-android/res/values/attrs.xml                       | 1 +
 vlc-android/res/values/colors.xml                      | 5 ++++-
 vlc-android/res/values/styles.xml                      | 2 ++
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/drawable/gradient_background_dark.xml b/vlc-android/res/drawable/gradient_background_dark.xml
new file mode 100644
index 000000000..23f9187e7
--- /dev/null
+++ b/vlc-android/res/drawable/gradient_background_dark.xml
@@ -0,0 +1,9 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <gradient
+        android:startColor="@color/grey850"
+        android:centerColor="@color/grey850transparent_dd"
+        android:endColor="@color/grey850transparent"
+        android:angle="270"
+        android:centerY="0.75" />
+</shape>
\ No newline at end of file
diff --git a/vlc-android/res/drawable/gradient_background_light.xml b/vlc-android/res/drawable/gradient_background_light.xml
new file mode 100644
index 000000000..0abe239c1
--- /dev/null
+++ b/vlc-android/res/drawable/gradient_background_light.xml
@@ -0,0 +1,9 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <gradient
+        android:startColor="@color/grey50"
+        android:centerColor="@color/grey50transparent_ea"
+        android:endColor="@color/grey50transparent"
+        android:angle="270"
+        android:centerY="0.75"/>
+</shape>
\ No newline at end of file
diff --git a/vlc-android/res/layout/recycler_section_header.xml b/vlc-android/res/layout/recycler_section_header.xml
index 8438900bf..1b4f8f121 100644
--- a/vlc-android/res/layout/recycler_section_header.xml
+++ b/vlc-android/res/layout/recycler_section_header.xml
@@ -2,7 +2,7 @@
 <TextView android:id="@+id/section_header"
     android:layout_width="match_parent"
     android:layout_height="48dp"
-    android:background="?attr/background_default"
+    android:background="?attr/background_default_gradient"
     android:paddingStart="24dp"
     android:paddingTop="@dimen/audio_item_header_padding"
     android:paddingEnd="28dp"
diff --git a/vlc-android/res/values/attrs.xml b/vlc-android/res/values/attrs.xml
index 8346fcbfd..7e7a72fac 100644
--- a/vlc-android/res/values/attrs.xml
+++ b/vlc-android/res/values/attrs.xml
@@ -3,6 +3,7 @@
 
     <attr name="item_footer" format="reference|color" />
     <attr name="background_default" format="reference|color" />
+    <attr name="background_default_gradient" format="reference|color" />
     <attr name="background_default_darker" format="reference|color" />
     <attr name="background_actionbar" format="reference|color" />
     <attr name="background_menu_divider" format="reference|color" />
diff --git a/vlc-android/res/values/colors.xml b/vlc-android/res/values/colors.xml
index 7b22e6878..d9bf07629 100644
--- a/vlc-android/res/values/colors.xml
+++ b/vlc-android/res/values/colors.xml
@@ -37,9 +37,12 @@
     <color name="grey875">#2a2a2a</color>
     <color name="grey900">#212121</color>
 
-    <color name="grey50transparent">#dcfafafa</color>
+    <color name="grey50transparent">#b9fafafa</color>
+    <color name="grey50transparent_ea">#eafafafa</color>
     <color name="grey400transparent">#80bdbdbd</color>
     <color name="grey600transparent">#80757575</color>
+    <color name="grey850transparent">#bb323232</color>
+    <color name="grey850transparent_dd">#dd323232</color>
     <color name="grey900transparent">#80212121</color>
 
     <color name="blacktransparent">#b4000000</color>
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index 5fd0443bc..27aa7f17a 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -25,6 +25,7 @@
         <item name="actionModeBackground">@color/orange500</item>
         <item name="item_footer">@color/grey300</item>
         <item name="background_default">@color/grey50</item>
+        <item name="background_default_gradient">@drawable/gradient_background_light</item>
         <item name="background_default_darker">@color/grey100</item>
         <item name="background_actionbar">@color/orange500</item>
         <item name="background_menu_divider">@color/grey400</item>
@@ -128,6 +129,7 @@
         <item name="windowActionModeOverlay">true</item>
         <item name="actionModeBackground">@color/grey875</item>
         <item name="background_default">@color/grey850</item>
+        <item name="background_default_gradient">@drawable/gradient_background_dark</item>
         <item name="background_default_darker">@color/grey875</item>
         <item name="background_actionbar">@color/grey875</item>
         <item name="background_menu_divider">@color/grey700</item>



More information about the Android mailing list