diff options
Diffstat (limited to 'core/src/main/java/de/danoeh/antennapod')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 18 |
1 files changed, 18 insertions, 0 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 713191fc0..65f303f65 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 @@ -7,6 +7,7 @@ import android.app.UiModeManager; import android.bluetooth.BluetoothA2dp; import android.content.BroadcastReceiver; import android.content.ComponentName; +import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -370,9 +371,26 @@ public class PlaybackService extends MediaBrowserServiceCompat { } private MediaBrowserCompat.MediaItem createBrowsableMediaItemForRoot() { + Uri uri = new Uri.Builder() + .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) + .authority(getResources().getResourcePackageName(R.drawable.ic_playlist_black)) + .appendPath(getResources().getResourceTypeName(R.drawable.ic_playlist_black)) + .appendPath(getResources().getResourceEntryName(R.drawable.ic_playlist_black)) + .build(); + + String subtitle = ""; + try { + int count = taskManager.getQueue().size(); + subtitle = getResources().getQuantityString(R.plurals.num_episodes, count, count); + } catch (InterruptedException e) { + e.printStackTrace(); + } + MediaDescriptionCompat description = new MediaDescriptionCompat.Builder() + .setIconUri(uri) .setMediaId(getResources().getString(R.string.queue_label)) .setTitle(getResources().getString(R.string.queue_label)) + .setSubtitle(subtitle) .build(); return new MediaBrowserCompat.MediaItem(description, MediaBrowserCompat.MediaItem.FLAG_BROWSABLE); |