[Android] Fix circle button background color in dialogs

Nicolas Pomepuy git at videolan.org
Wed Jul 17 11:19:35 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Jul 17 08:41:44 2019 +0200| [7970e94e33c8890a9484f5ee9acb553efd1683b7] | committer: Geoffrey Métais

Fix circle button background color in dialogs

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

 vlc-android/res/color/dialog_circle_background.xml |  7 ++++++
 .../res/color/dialog_circle_background_dark.xml    |  7 ++++++
 .../res/drawable/ic_down_on_circle_dialog.xml      | 26 ++++++++++++++++++++++
 .../res/drawable/ic_up_on_circle_dialog.xml        | 26 ++++++++++++++++++++++
 vlc-android/res/layout/dialog_playback_speed.xml   |  4 ++--
 vlc-android/res/values/attrs.xml                   |  1 +
 vlc-android/res/values/styles.xml                  |  2 ++
 7 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/color/dialog_circle_background.xml b/vlc-android/res/color/dialog_circle_background.xml
new file mode 100644
index 000000000..fa8331153
--- /dev/null
+++ b/vlc-android/res/color/dialog_circle_background.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_focused="true" android:color="@color/orange500focus"/>
+    <item android:state_selected="true" android:color="@color/orange500focus"/>
+    <item android:state_pressed="true" android:color="@color/orange500focus"/>
+    <item android:color="@color/grey400"/>
+</selector>
\ No newline at end of file
diff --git a/vlc-android/res/color/dialog_circle_background_dark.xml b/vlc-android/res/color/dialog_circle_background_dark.xml
new file mode 100644
index 000000000..104416abb
--- /dev/null
+++ b/vlc-android/res/color/dialog_circle_background_dark.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_focused="true" android:color="@color/orange500focus"/>
+    <item android:state_selected="true" android:color="@color/orange500focus"/>
+    <item android:state_pressed="true" android:color="@color/orange500focus"/>
+    <item android:color="@color/grey800"/>
+</selector>
\ No newline at end of file
diff --git a/vlc-android/res/drawable/ic_down_on_circle_dialog.xml b/vlc-android/res/drawable/ic_down_on_circle_dialog.xml
new file mode 100644
index 000000000..937cb9bfd
--- /dev/null
+++ b/vlc-android/res/drawable/ic_down_on_circle_dialog.xml
@@ -0,0 +1,26 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="48dp"
+        android:height="48dp"
+        android:viewportWidth="48"
+        android:viewportHeight="48">
+    <path
+            android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
+            android:strokeAlpha="1"
+            android:strokeLineJoin="round"
+            android:strokeWidth="15.1181097"
+            android:fillColor="?attr/dialog_circle_background"
+            android:strokeColor="#00000000"
+            android:fillType="nonZero"
+            android:fillAlpha="0.75294118"
+            android:strokeLineCap="butt"/>
+    <path
+            android:pathData="m24.0004,32.6215a1.5,1.5 0,0 1,-1.0605 -0.4395l-10.4854,-10.4853 -0.015,-0.015A1.5,1.5 0,0 1,12 20.6211a1.5,1.5 0,0 1,1.5 -1.5,1.5 1.5,0 0,1 1.0605,0.4395L24,29l9.4248,-9.4248a1.5,1.5 0,0 1,1.0752 -0.4541,1.5 1.5,0 0,1 1.5,1.5 1.5,1.5 0,0 1,-0.4395 1.0605L25.0752,32.1671a1.5,1.5 0,0 1,-1.0748 0.4543z"
+            android:strokeAlpha="1"
+            android:strokeLineJoin="round"
+            android:strokeWidth="3"
+            android:fillColor="?attr/player_icon_color"
+            android:strokeColor="#00000000"
+            android:fillType="nonZero"
+            android:fillAlpha="1"
+            android:strokeLineCap="round"/>
+</vector>
diff --git a/vlc-android/res/drawable/ic_up_on_circle_dialog.xml b/vlc-android/res/drawable/ic_up_on_circle_dialog.xml
new file mode 100644
index 000000000..33930c3d8
--- /dev/null
+++ b/vlc-android/res/drawable/ic_up_on_circle_dialog.xml
@@ -0,0 +1,26 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="48dp"
+        android:height="48dp"
+        android:viewportWidth="48"
+        android:viewportHeight="48">
+    <path
+            android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
+            android:strokeAlpha="1"
+            android:strokeLineJoin="round"
+            android:strokeWidth="15.1181097"
+            android:fillColor="?attr/dialog_circle_background"
+            android:strokeColor="#00000000"
+            android:fillType="nonZero"
+            android:fillAlpha="0.75294118"
+            android:strokeLineCap="butt"/>
+    <path
+            android:pathData="m24.0004,15.303a1.5,1.5 0,0 0,-1.0605 0.4395l-10.4854,10.4853 -0.015,0.015a1.5,1.5 0,0 0,-0.4395 1.0605,1.5 1.5,0 0,0 1.5,1.5 1.5,1.5 0,0 0,1.0605 -0.4395L24,18.9244l9.4248,9.4248a1.5,1.5 0,0 0,1.0752 0.4541,1.5 1.5,0 0,0 1.5,-1.5 1.5,1.5 0,0 0,-0.4395 -1.0605l-10.4853,-10.4855a1.5,1.5 0,0 0,-1.0748 -0.4543z"
+            android:strokeAlpha="1"
+            android:strokeLineJoin="round"
+            android:strokeWidth="3"
+            android:fillColor="?attr/player_icon_color"
+            android:strokeColor="#00000000"
+            android:fillType="nonZero"
+            android:fillAlpha="1"
+            android:strokeLineCap="round"/>
+</vector>
diff --git a/vlc-android/res/layout/dialog_playback_speed.xml b/vlc-android/res/layout/dialog_playback_speed.xml
index 020226ef4..aa17e0f89 100644
--- a/vlc-android/res/layout/dialog_playback_speed.xml
+++ b/vlc-android/res/layout/dialog_playback_speed.xml
@@ -94,7 +94,7 @@
             android:padding="0dp"
             android:nextFocusUp="@+id/playback_speed_seek"
             android:nextFocusDown="@+id/playback_speed_minus"
-            app:srcCompat="@drawable/ic_up_on_circle_player"
+            app:srcCompat="@drawable/ic_up_on_circle_dialog"
             app:layout_constraintBottom_toTopOf="@+id/playback_speed_minus"
             app:layout_constraintEnd_toEndOf="parent"/>
 
@@ -108,7 +108,7 @@
             android:nextFocusDown="@+id/playback_speed_icon"
             app:backgroundTint="@color/transparent"
             android:padding="0dp"
-            app:srcCompat="@drawable/ic_down_on_circle_player"
+            app:srcCompat="@drawable/ic_down_on_circle_dialog"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"/>
 
diff --git a/vlc-android/res/values/attrs.xml b/vlc-android/res/values/attrs.xml
index 2cd3c3b37..ce4597852 100644
--- a/vlc-android/res/values/attrs.xml
+++ b/vlc-android/res/values/attrs.xml
@@ -70,6 +70,7 @@
     <attr name="ic_crop_player" format="reference" />
     <attr name="ic_dial" format="reference" />
     <attr name="player_icon_color" format="reference" />
+    <attr name="dialog_circle_background" format="reference"/>
 
     <attr name="shadow_top_9patch" format="reference"/>
     <attr name="shadow_bottom_9patch" format="reference"/>
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index 0c8564822..b9a81e18e 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -42,6 +42,7 @@
         <item name="audio_browser_separator">@color/orange500</item>
         <item name="playlist_item_drag_shadow">@color/orange500</item>
         <item name="audio_player_header_time">@color/orange500</item>
+        <item name="dialog_circle_background">@color/dialog_circle_background</item>
         <item name="font_default">@color/grey900</item>
         <item name="font_light">@color/grey700</item>
         <item name="font_audio_light">@color/grey700</item>
@@ -143,6 +144,7 @@
         <item name="audio_browser_separator">@color/orange500</item>
         <item name="playlist_item_drag_shadow">@color/orange500</item>
         <item name="audio_player_header_time">@color/orange500</item>
+        <item name="dialog_circle_background">@color/dialog_circle_background_dark</item>
         <item name="font_default">@color/grey50</item>
         <item name="font_light">@color/grey600</item>
         <item name="font_audio_light">@color/grey400</item>



More information about the Android mailing list