Skip to content

Commit

Permalink
Update:Android notification image to not resize #657
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Apr 19, 2024
1 parent e301b30 commit e94d6fd
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.ui.PlayerNotificationManager
import kotlinx.coroutines.*

const val NOTIFICATION_LARGE_ICON_SIZE = 144 // px

class AbMediaDescriptionAdapter constructor(private val controller: MediaControllerCompat, private val playerNotificationService: PlayerNotificationService) : PlayerNotificationManager.MediaDescriptionAdapter {
private val tag = "MediaDescriptionAdapter"

Expand Down Expand Up @@ -77,15 +75,15 @@ class AbMediaDescriptionAdapter constructor(private val controller: MediaControl
.load(uri)
.placeholder(R.drawable.icon)
.error(R.drawable.icon)
.submit(NOTIFICATION_LARGE_ICON_SIZE, NOTIFICATION_LARGE_ICON_SIZE)
.submit()
.get()
} catch (e: Exception) {
e.printStackTrace()

Glide.with(playerNotificationService)
.asBitmap()
.load(Uri.parse("android.resource://${BuildConfig.APPLICATION_ID}/" + R.drawable.icon))
.submit(NOTIFICATION_LARGE_ICON_SIZE, NOTIFICATION_LARGE_ICON_SIZE)
.submit()
.get()
}
}
Expand Down

0 comments on commit e94d6fd

Please sign in to comment.