diff --git a/goonj/src/main/java/ai/rever/goonj/audioplayer/local/LocalPlayer.kt b/goonj/src/main/java/ai/rever/goonj/audioplayer/local/LocalPlayer.kt index 9ccb890..44531f2 100644 --- a/goonj/src/main/java/ai/rever/goonj/audioplayer/local/LocalPlayer.kt +++ b/goonj/src/main/java/ai/rever/goonj/audioplayer/local/LocalPlayer.kt @@ -128,7 +128,7 @@ class LocalPlayer (var weakReferenceService: WeakReference) : AudioPlay @Nullable override fun getCurrentLargeIcon(player: Player, callback: PlayerNotificationManager.BitmapCallback): Bitmap { - return Samples.getBitmap(context, playList[player.currentWindowIndex].bitmapResource)!! + return playList[player.currentWindowIndex].bitmap?: Samples.getBitmap(context, playList[player.currentWindowIndex].bitmapResource)!! } } @@ -157,7 +157,6 @@ class LocalPlayer (var weakReferenceService: WeakReference) : AudioPlay smallIcon?.let { playerNotificationManager.setSmallIcon(it) } - } private fun setupMediaSession(){ diff --git a/goonj/src/main/java/ai/rever/goonj/audioplayer/models/Samples.kt b/goonj/src/main/java/ai/rever/goonj/audioplayer/models/Samples.kt index 3a316e1..79df215 100644 --- a/goonj/src/main/java/ai/rever/goonj/audioplayer/models/Samples.kt +++ b/goonj/src/main/java/ai/rever/goonj/audioplayer/models/Samples.kt @@ -4,6 +4,7 @@ import ai.rever.goonj.R import android.content.Context import androidx.annotation.DrawableRes import android.graphics.Bitmap +import android.graphics.BitmapFactory import android.support.v4.media.MediaDescriptionCompat import android.support.v4.media.MediaMetadataCompat import android.os.Bundle @@ -75,7 +76,7 @@ object Samples { var timestamp: Long = 0 var remoteItemId: String? = null var bitmapResource: Int = R.mipmap.ic_album_art - var bitmap: Bitmap? =null + var bitmap: Bitmap? = null override fun toString(): String { return "$title Description: $artist DURATION: $duration INDEX: $index state: $state"