mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 01:20:29 +05:30
Added artist metadata to AOD.
This commit is contained in:
parent
76e5aa4008
commit
93c4732978
@ -1,5 +1,6 @@
|
|||||||
package com.github.libretube.util
|
package com.github.libretube.util
|
||||||
|
|
||||||
|
import android.R.attr.data
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
@ -10,7 +11,9 @@ import android.graphics.Bitmap
|
|||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
import android.support.v4.media.MediaDescriptionCompat
|
import android.support.v4.media.MediaDescriptionCompat
|
||||||
|
import android.support.v4.media.MediaMetadataCompat
|
||||||
import android.support.v4.media.session.MediaSessionCompat
|
import android.support.v4.media.session.MediaSessionCompat
|
||||||
import coil.request.ImageRequest
|
import coil.request.ImageRequest
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
@ -142,8 +145,16 @@ class NowPlayingNotification(
|
|||||||
return MediaDescriptionCompat.Builder().apply {
|
return MediaDescriptionCompat.Builder().apply {
|
||||||
setTitle(streams?.title!!)
|
setTitle(streams?.title!!)
|
||||||
setSubtitle(streams?.uploader)
|
setSubtitle(streams?.uploader)
|
||||||
setIconBitmap(BitmapFactory.decodeResource(
|
val extras = Bundle()
|
||||||
Resources.getSystem(), R.drawable.ic_launcher_monochrome))
|
val appIcon = BitmapFactory.decodeResource(
|
||||||
|
Resources.getSystem(),
|
||||||
|
R.drawable.ic_launcher_monochrome
|
||||||
|
)
|
||||||
|
extras.putParcelable(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, appIcon)
|
||||||
|
extras.putString(MediaMetadataCompat.METADATA_KEY_TITLE, streams?.title!!)
|
||||||
|
extras.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, streams?.uploader)
|
||||||
|
setIconBitmap(appIcon)
|
||||||
|
setExtras(extras)
|
||||||
}.build()
|
}.build()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user