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

Geoffrey Métais geoffrey at videolan.org
Thu Apr 26 11:46:44 CEST 2018


We may reword "Blurred cover for audio backgrounds" to something like
"Blurred cover in audio player background".
It's not clear where it applies otherwise.

I'd have put the prefs check upper in the code, in the first line of
updateBackground():
if (AndroidUtil.isJellyBeanMR1OrLater &&
settings.getBoolean("blurred_cover_background", true)) {
...
}

To manage it as we do for pre JellyBean devices.

then, this preferences has to be hidden for devices pre-jellybean, and also
on TV.

Le mer. 25 avr. 2018 à 18:28, Hamza Parnica <hparnica at gmail.com> a écrit :

> ---
>  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
>
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20180426/bbf90d8e/attachment-0001.html>


More information about the Android mailing list