[Android] [PATCH] Allow user to disable blurred art cover

Hamza Parnica hparnica at gmail.com
Fri Apr 27 10:58:05 CEST 2018


---
 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 +-
 .../src/org/videolan/vlc/gui/preferences/PreferencesUi.java | 1 +
 .../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 2e795e6f8..8ce516a1d 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
-- 
2.17.0



More information about the Android mailing list