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

Hamza Parnica hparnica at gmail.com
Wed Apr 25 18:28:22 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 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 2e795e6f8..e63519e17 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 for audio backgrounds</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..6c4d4ff6a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -274,7 +274,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, PlaybackSe
                 val mw = service?.currentMediaWrapper
                 if (mw === null || TextUtils.equals(currentCoverArt, mw.artworkMrl)) return at launch
                 currentCoverArt = mw.artworkMrl
-                if (TextUtils.isEmpty(mw.artworkMrl)) {
+                if (TextUtils.isEmpty(mw.artworkMrl) || !settings.getBoolean("blurred_cover_background", true)) {
                     setDefaultBackground()
                 } else {
                     val blurredCover = async { UiTools.blurBitmap(AudioUtil.readCoverBitmap(Uri.decode(mw.artworkMrl), binding.contentLayout.width)) }.await()
-- 
2.17.0



More information about the Android mailing list