Notification subtext album name (#672)

* Playlist already added song prevention & AndroidSlidingUpPanel repo Update

* Adding album name next to the app name on the notificaiton card, to have a similar look as the spotify app

* Code Refactor - Fixed code as requested
This commit is contained in:
7sco 2019-05-16 19:27:18 -04:00 committed by Eugene
commit 60f5c72219
2 changed files with 3 additions and 2 deletions

View file

@ -71,6 +71,7 @@ public class PlayingNotificationImpl extends PlayingNotification {
final Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID) final Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setSubText(song.albumName)
.setContentIntent(clickIntent) .setContentIntent(clickIntent)
.setDeleteIntent(deleteIntent) .setDeleteIntent(deleteIntent)
.setCategory(NotificationCompat.CATEGORY_SERVICE) .setCategory(NotificationCompat.CATEGORY_SERVICE)

View file

@ -37,7 +37,6 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
final Song song = service.getCurrentSong(); final Song song = service.getCurrentSong();
final boolean isPlaying = service.isPlaying(); final boolean isPlaying = service.isPlaying();
final String text = MusicUtil.getSongInfoString(song);
final int playButtonResId = isPlaying final int playButtonResId = isPlaying
? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp; ? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp;
@ -81,11 +80,12 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
retrievePlaybackAction(ACTION_SKIP)); retrievePlaybackAction(ACTION_SKIP));
NotificationCompat.Builder builder = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID) NotificationCompat.Builder builder = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setSubText(song.albumName)
.setLargeIcon(bitmap) .setLargeIcon(bitmap)
.setContentIntent(clickIntent) .setContentIntent(clickIntent)
.setDeleteIntent(deleteIntent) .setDeleteIntent(deleteIntent)
.setContentTitle(song.title) .setContentTitle(song.title)
.setContentText(text) .setContentText(song.artistName)
.setOngoing(isPlaying) .setOngoing(isPlaying)
.setShowWhen(false) .setShowWhen(false)
.addAction(previousAction) .addAction(previousAction)