[Android] Add the audio player safety gradients

Nicolas Pomepuy git at videolan.org
Tue Aug 3 12:53:19 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Aug  2 14:11:09 2021 +0200| [da429a97186f64709b9c547f94b1d8cebe9283ce] | committer: Nicolas Pomepuy

Add the audio player safety gradients

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

 .../res/drawable/gradient_audio_player_bottom.xml  |  5 ++++
 .../drawable/gradient_audio_player_bottom_dark.xml |  5 ++++
 .../res/drawable/gradient_audio_player_top.xml     |  5 ++++
 .../drawable/gradient_audio_player_top_dark.xml    |  5 ++++
 .../resources/src/main/res/values/attrs.xml        |  2 ++
 .../vlc-android/res/layout-land/audio_player.xml   | 33 ++++++++++++++++++++++
 .../vlc-android/res/layout/audio_player.xml        | 33 ++++++++++++++++++++++
 application/vlc-android/res/values/styles.xml      |  4 +++
 8 files changed, 92 insertions(+)

diff --git a/application/resources/src/main/res/drawable/gradient_audio_player_bottom.xml b/application/resources/src/main/res/drawable/gradient_audio_player_bottom.xml
new file mode 100644
index 000000000..7092598a8
--- /dev/null
+++ b/application/resources/src/main/res/drawable/gradient_audio_player_bottom.xml
@@ -0,0 +1,5 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <gradient android:angle="90" android:startColor="@color/white_transparent_80" android:endColor="@color/transparent"/>
+</shape>
\ No newline at end of file
diff --git a/application/resources/src/main/res/drawable/gradient_audio_player_bottom_dark.xml b/application/resources/src/main/res/drawable/gradient_audio_player_bottom_dark.xml
new file mode 100644
index 000000000..a664b4f4d
--- /dev/null
+++ b/application/resources/src/main/res/drawable/gradient_audio_player_bottom_dark.xml
@@ -0,0 +1,5 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <gradient android:angle="90" android:startColor="@color/black_transparent_80" android:endColor="@color/transparent"/>
+</shape>
\ No newline at end of file
diff --git a/application/resources/src/main/res/drawable/gradient_audio_player_top.xml b/application/resources/src/main/res/drawable/gradient_audio_player_top.xml
new file mode 100644
index 000000000..3a0b06323
--- /dev/null
+++ b/application/resources/src/main/res/drawable/gradient_audio_player_top.xml
@@ -0,0 +1,5 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <gradient android:angle="270" android:startColor="@color/white_transparent_80" android:endColor="@color/transparent"/>
+</shape>
\ No newline at end of file
diff --git a/application/resources/src/main/res/drawable/gradient_audio_player_top_dark.xml b/application/resources/src/main/res/drawable/gradient_audio_player_top_dark.xml
new file mode 100644
index 000000000..348e9a407
--- /dev/null
+++ b/application/resources/src/main/res/drawable/gradient_audio_player_top_dark.xml
@@ -0,0 +1,5 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <gradient android:angle="270" android:startColor="@color/black_transparent_80" android:endColor="@color/transparent"/>
+</shape>
\ No newline at end of file
diff --git a/application/resources/src/main/res/values/attrs.xml b/application/resources/src/main/res/values/attrs.xml
index e7afc99ca..d698589e4 100644
--- a/application/resources/src/main/res/values/attrs.xml
+++ b/application/resources/src/main/res/values/attrs.xml
@@ -72,6 +72,8 @@
     <attr name="fast_scroller_bubble" format="reference" />
     <attr name="fast_scroller_handle" format="reference" />
     <attr name="empty_title" format="color" />
+    <attr name="audio_player_gradient_bottom" format="reference" />
+    <attr name="audio_player_gradient_top" format="reference" />
     <attr name="tips_item_background" format="color" />
 
     <!--Main Icons-->
diff --git a/application/vlc-android/res/layout-land/audio_player.xml b/application/vlc-android/res/layout-land/audio_player.xml
index dac6dce7c..9a20afb2c 100644
--- a/application/vlc-android/res/layout-land/audio_player.xml
+++ b/application/vlc-android/res/layout-land/audio_player.xml
@@ -41,6 +41,39 @@
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent" />
 
+        <View
+                android:id="@+id/bottom_gradient"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:background="?attr/audio_player_gradient_bottom"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="@+id/guideline8" />
+
+        <View
+                android:id="@+id/top_gradient"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:background="?attr/audio_player_gradient_top"
+                app:layout_constraintBottom_toBottomOf="@id/guideline9"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+        <androidx.constraintlayout.widget.Guideline
+                android:id="@+id/guideline8"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                app:layout_constraintGuide_percent="0.65" />
+        <androidx.constraintlayout.widget.Guideline
+                android:id="@+id/guideline9"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                app:layout_constraintGuide_percent="0.3" />
+
         <ProgressBar
                 android:id="@+id/progressBar"
                 style="@android:style/Widget.ProgressBar.Horizontal"
diff --git a/application/vlc-android/res/layout/audio_player.xml b/application/vlc-android/res/layout/audio_player.xml
index 4cdae2bdd..7589f250f 100644
--- a/application/vlc-android/res/layout/audio_player.xml
+++ b/application/vlc-android/res/layout/audio_player.xml
@@ -41,6 +41,39 @@
                 app:layout_constraintRight_toRightOf="parent"
                 app:layout_constraintTop_toTopOf="parent" />
 
+        <View
+                android:id="@+id/bottom_gradient"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:background="?attr/audio_player_gradient_bottom"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="@+id/guideline8" />
+
+        <View
+                android:id="@+id/top_gradient"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:background="?attr/audio_player_gradient_top"
+                app:layout_constraintBottom_toBottomOf="@id/guideline9"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+        <androidx.constraintlayout.widget.Guideline
+                android:id="@+id/guideline8"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                app:layout_constraintGuide_percent="0.65" />
+        <androidx.constraintlayout.widget.Guideline
+                android:id="@+id/guideline9"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                app:layout_constraintGuide_percent="0.3" />
+
         <ProgressBar
                 android:id="@+id/progressBar"
                 style="@android:style/Widget.ProgressBar.Horizontal"
diff --git a/application/vlc-android/res/values/styles.xml b/application/vlc-android/res/values/styles.xml
index b83937bf2..76c165b67 100644
--- a/application/vlc-android/res/values/styles.xml
+++ b/application/vlc-android/res/values/styles.xml
@@ -111,6 +111,8 @@
         <item name="audio_chip_background">@drawable/rounded_corners_audio</item>
         <item name="audio_chip_text_color">@color/white_transparent_60</item>
         <item name="empty_title">@color/grey850</item>
+        <item name="audio_player_gradient_bottom">@drawable/gradient_audio_player_bottom</item>
+        <item name="audio_player_gradient_top">@drawable/gradient_audio_player_top</item>
         <item name="tips_item_background">@color/grey300</item>
     </style>
 
@@ -269,6 +271,8 @@
         <item name="audio_chip_background">@drawable/rounded_corners_audio_dark</item>
         <item name="audio_chip_text_color">@color/black_transparent_60</item>
         <item name="empty_title">@color/grey300</item>
+        <item name="audio_player_gradient_bottom">@drawable/gradient_audio_player_bottom_dark</item>
+        <item name="audio_player_gradient_top">@drawable/gradient_audio_player_top_dark</item>
         <item name="tips_item_background">@color/grey900</item>
     </style>
 



More information about the Android mailing list