mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Standardized the logic for obtaining coverArt
This commit is contained in:
parent
6275ad0bdc
commit
a2a6dc9f15
3 changed files with 3 additions and 2 deletions
|
|
@ -144,7 +144,7 @@ public class PlayerBottomSheetFragment extends Fragment {
|
|||
bind.playerHeaderLayout.playerHeaderMediaArtistLabel.setText(MusicUtil.getReadableString(String.valueOf(mediaMetadata.artist)));
|
||||
|
||||
if (mediaMetadata.extras != null) CustomGlideRequest.Builder
|
||||
.from(requireContext(), mediaMetadata.extras.getString("id"), CustomGlideRequest.SONG_PIC, null)
|
||||
.from(requireContext(), mediaMetadata.extras.getString("coverArtId"), CustomGlideRequest.SONG_PIC, null)
|
||||
.build()
|
||||
.transform(new RoundedCorners(CustomGlideRequest.CORNER_RADIUS))
|
||||
.into(bind.playerHeaderLayout.playerHeaderMediaCoverImage);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class PlayerCoverFragment extends Fragment {
|
|||
@SuppressLint("UnsafeOptInUsageError")
|
||||
private void setCover(MediaMetadata mediaMetadata) {
|
||||
CustomGlideRequest.Builder
|
||||
.from(requireContext(), mediaMetadata.extras != null ? mediaMetadata.extras.getString("id") : null, CustomGlideRequest.SONG_PIC, null)
|
||||
.from(requireContext(), mediaMetadata.extras != null ? mediaMetadata.extras.getString("coverArtId") : null, CustomGlideRequest.SONG_PIC, null)
|
||||
.build()
|
||||
.transform(new RoundedCorners(CustomGlideRequest.CORNER_RADIUS))
|
||||
.into(bind.nowPlayingSongCoverImageView);
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ public class MappingUtil {
|
|||
bundle.putString("id", media.getId());
|
||||
bundle.putString("albumId", media.getAlbumId());
|
||||
bundle.putString("artistId", media.getArtistId());
|
||||
bundle.putString("coverArtId", media.getCoverArtId());
|
||||
bundle.putString("mediaType", media.getType());
|
||||
|
||||
return new MediaItem.Builder()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue