diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
index 39866cc8..71780bf0 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java
@@ -141,6 +141,8 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
private boolean notHandledMetaChangedForCurrentTrack;
private boolean isServiceInUse;
+ private BlurProcessor blurProcessor = new BlurProcessor.Builder(this).build();
+
private static String getTrackUri(@NonNull Song song) {
return MusicUtil.getSongUri(song.id).toString();
}
@@ -430,10 +432,10 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
}
private void updateRemoteControlClient() {
- updateRemoteControlClientImpl(PreferenceUtil.getInstance(this).albumArtOnLockscreen());
+ updateRemoteControlClient(PreferenceUtil.getInstance(this).albumArtOnLockscreen(), PreferenceUtil.getInstance(this).blurredAlbumArt());
}
- private void updateRemoteControlClientImpl(boolean showAlbumArt) {
+ private void updateRemoteControlClient(boolean showAlbumArt, boolean blurAlbumArt) {
final Song song = getCurrentSong();
remoteControlClient
.editMetadata(!showAlbumArt)
@@ -447,7 +449,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
ImageLoader.getInstance().displayImage(
currentAlbumArtUri,
new NonViewAware(new ImageSize(screenSize.x, screenSize.y), ViewScaleType.CROP),
- new DisplayImageOptions.Builder().postProcessor(new BlurProcessor.Builder(this).build()).build(),
+ new DisplayImageOptions.Builder().postProcessor(blurAlbumArt ? blurProcessor : null).build(),
new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, @Nullable Bitmap loadedImage) {
@@ -914,7 +916,8 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
}
break;
case PreferenceUtil.ALBUM_ART_ON_LOCKSCREEN:
- updateRemoteControlClientImpl(sharedPreferences.getBoolean(key, true));
+ case PreferenceUtil.BLURRED_ALBUM_ART:
+ updateRemoteControlClient();
break;
case PreferenceUtil.COLORED_NOTIFICATION:
playingNotificationHelper.updateNotification(sharedPreferences.getBoolean(key, false));
diff --git a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
index d5d274ef..abe69af3 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/util/PreferenceUtil.java
@@ -53,6 +53,7 @@ public final class PreferenceUtil {
public static final String LAST_ADDED_CUTOFF_TIMESTAMP = "last_added_cutoff_timestamp";
public static final String ALBUM_ART_ON_LOCKSCREEN = "album_art_on_lockscreen";
+ public static final String BLURRED_ALBUM_ART = "blurred_album_art";
public static final String LAST_SLEEP_TIMER_VALUE = "last_sleep_timer_value";
public static final String NEXT_SLEEP_TIMER_ELAPSED_REALTIME = "next_sleep_timer_elapsed_real_time";
@@ -195,6 +196,10 @@ public final class PreferenceUtil {
return mPreferences.getBoolean(ALBUM_ART_ON_LOCKSCREEN, true);
}
+ public final boolean blurredAlbumArt() {
+ return mPreferences.getBoolean(BLURRED_ALBUM_ART, false);
+ }
+
public final boolean ignoreMediaStoreArtwork() {
return mPreferences.getBoolean(IGNORE_MEDIA_STORE_ARTWORK, false);
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index afce7a63..723cc12d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -100,7 +100,8 @@
Lockscreen
Colored navigation bar
Start page
- Album cover on lockscreen
+ Show album cover
+ Blur album cover
Colored notification
Ignore Media Store covers
Gapless playback
@@ -136,6 +137,7 @@
Song
"Only available on Lollipop."
Uses the current songs album cover as lockscreen wallpaper.
+ Blurs the album cover on the lockscreen. Can cause problems with third party widgets and apps.
"Colors the notification in the album cover\u2019s vibrant color."
"Can cause playback issues on some devices."
Album covers in the now playing view are always squared.
diff --git a/app/src/main/res/xml/pref_lockscreen.xml b/app/src/main/res/xml/pref_lockscreen.xml
index 81cdaa4c..a8dfcedd 100644
--- a/app/src/main/res/xml/pref_lockscreen.xml
+++ b/app/src/main/res/xml/pref_lockscreen.xml
@@ -3,11 +3,20 @@
+
+