diff options
author | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-06-28 15:48:51 -0400 |
---|---|---|
committer | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-06-28 15:48:51 -0400 |
commit | 47015e937e31426b6b638eb4964befad27d86ca5 (patch) | |
tree | e63ec6d5d492a750fffc54e8b81c6a08c4eb1998 /core/src | |
parent | 6d0debfd4d0c19ebe0287b136072b05ae6d8e65f (diff) | |
download | AntennaPod-47015e937e31426b6b638eb4964befad27d86ca5.zip |
add onClickListeners, optimize image loading
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index c79d662cb..88b2c70de 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -939,16 +939,16 @@ public class PlaybackService extends Service { MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder(); builder.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, p.getFeedTitle()); builder.putString(MediaMetadataCompat.METADATA_KEY_TITLE, p.getEpisodeTitle()); + builder.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, p.getFeedTitle()); builder.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, p.getDuration()); builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, p.getEpisodeTitle()); - builder.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, p.getFeedTitle()); + builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE, p.getFeedTitle()); String imageLocation = p.getImageLocation(); if (!TextUtils.isEmpty(imageLocation)) { - if (isCasting || UserPreferences.setLockscreenBackground()) { + if (UserPreferences.setLockscreenBackground()) { builder.putString(MediaMetadataCompat.METADATA_KEY_ART_URI, imageLocation); - builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON_URI, imageLocation); try { Bitmap art = Glide.with(this) .load(imageLocation) @@ -957,18 +957,12 @@ public class PlaybackService extends Service { .into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) .get(); builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, art); - // Icon is useful for MediaDescription, - Bitmap icon = Glide.with(this) - .load(imageLocation) - .asBitmap() - .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .fitCenter() - .into(128, 128) - .get(); - builder.putBitmap(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, icon); } catch (Throwable tr) { Log.e(TAG, Log.getStackTraceString(tr)); } + } else if (isCasting) { + // In the absence of metadata art, the controller dialog takes care of creating it. + builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON_URI, imageLocation); } } if (!Thread.currentThread().isInterrupted() && started) { |