mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Fix that the notification thumbnail doesn't load sometimes
This commit is contained in:
parent
930df73efa
commit
1641c75146
@ -110,20 +110,19 @@ class NowPlayingNotification(
|
||||
val request = ImageRequest.Builder(context)
|
||||
.data(streams?.thumbnailUrl)
|
||||
.target { result ->
|
||||
bitmap = (result as BitmapDrawable).bitmap
|
||||
val bm = (result as BitmapDrawable).bitmap
|
||||
// returns the bitmap on Android 13+, for everything below scaled down to a square
|
||||
bitmap = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
ImageHelper.getSquareBitmap(bm)
|
||||
} else bm
|
||||
callback.onBitmap(bitmap!!)
|
||||
}
|
||||
.build()
|
||||
|
||||
// enqueue the thumbnail loading request
|
||||
ImageHelper.imageLoader.enqueue(request)
|
||||
|
||||
// returns the bitmap on Android 13+, for everything below scaled down to a square
|
||||
return if (
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU
|
||||
) {
|
||||
ImageHelper.getSquareBitmap(bitmap)
|
||||
} else {
|
||||
bitmap
|
||||
}
|
||||
return bitmap
|
||||
}
|
||||
|
||||
override fun getCurrentSubText(player: Player): CharSequence? {
|
||||
|
Loading…
x
Reference in New Issue
Block a user