[Android] Allow user to disable blurred art cover

Hamza Parnica git at videolan.org
Fri Jun 29 14:56:55 CEST 2018


vlc-android | branch: master | Hamza Parnica <hparnica at gmail.com> | Fri Apr 27 10:58:05 2018 +0200| [7111329957e4d1edf327d132e87f5198c5d25cdd] | committer: Geoffrey Métais

Allow user to disable blurred art cover

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

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

 vlc-android/res/values/strings.xml                                  | 2 ++
 vlc-android/res/xml/preferences_ui.xml                              | 6 ++++++
 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt           | 2 +-
 vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java | 1 +
 .../src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java      | 1 +
 5 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 5050f2eab..b313b2aa9 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -431,6 +431,8 @@
     <string name="network_caching_summary">The amount of time to buffer network media (in ms). Does not work with hardware decoding. Leave blank to reset.</string>
     <string name="resume_playback_title">Resume playback after a call</string>
     <string name="resume_playback_summary">Stay in pause otherwise</string>
+    <string name="blurred_cover_background_title">Blurred cover background</string>
+    <string name="blurred_cover_background_summary">Blurred cover in audio player background</string>
     <string name="network_caching_popup">This value must be between 0 and 6000 ms</string>
     <string name="quit">Quit and restart application</string>
 
diff --git a/vlc-android/res/xml/preferences_ui.xml b/vlc-android/res/xml/preferences_ui.xml
index 266688c93..16b4611f1 100644
--- a/vlc-android/res/xml/preferences_ui.xml
+++ b/vlc-android/res/xml/preferences_ui.xml
@@ -41,6 +41,12 @@
         android:summary="@string/resume_playback_summary"
         android:title="@string/resume_playback_title" />
 
+    <CheckBoxPreference
+        android:defaultValue="true"
+        android:key="blurred_cover_background"
+        android:summary="@string/blurred_cover_background_summary"
+        android:title="@string/blurred_cover_background_title" />
+
     <PreferenceCategory
         android:title="@string/interface_secondary_display_category_title"
         android:key="secondary_display_category">
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index b39b6c2b0..0a51e11d7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -269,7 +269,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, PlaybackSe
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
     private fun updateBackground() {
-        if (AndroidUtil.isJellyBeanMR1OrLater) {
+        if (AndroidUtil.isJellyBeanMR1OrLater && settings.getBoolean("blurred_cover_background", true)) {
             launch(UI, CoroutineStart.UNDISPATCHED) {
                 val mw = service?.currentMediaWrapper
                 if (mw === null || TextUtils.equals(currentCoverArt, mw.artworkMrl)) return at launch
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
index bbfb6aa34..4a3b901b5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
@@ -62,6 +62,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         findPreference("tv_ui").setVisible(AndroidUtil.isJellyBeanMR1OrLater);
+        findPreference("blurred_cover_background").setVisible(AndroidUtil.isJellyBeanMR1OrLater);
     }
 
     @Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
index 91cb6ee56..cbdda75b7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
@@ -55,6 +55,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
         findPreference("secondary_display_category").setVisible(false);
         findPreference("secondary_display_category_summary").setVisible(false);
         findPreference("daynight").setVisible(false);
+        findPreference("blurred_cover_background").setVisible(false);
     }
 
     @Override



More information about the Android mailing list