This commit is contained in:
Maxence G 2022-07-02 21:51:28 +02:00
parent 3f408600cb
commit d6aebd9989
No known key found for this signature in database
GPG Key ID: DC1FD9409E3FE284
3 changed files with 4 additions and 9 deletions

View File

@ -8,9 +8,7 @@
package org.moire.ultrasonic.playback
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.Looper
import android.widget.Toast
import android.widget.Toast.LENGTH_SHORT
import androidx.media3.common.HeartRating
@ -40,11 +38,8 @@ import com.google.common.util.concurrent.MoreExecutors
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.Runnable
import kotlinx.coroutines.guava.future
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import org.checkerframework.checker.units.qual.Length
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import org.moire.ultrasonic.R
@ -60,7 +55,6 @@ import org.moire.ultrasonic.service.MusicServiceFactory
import org.moire.ultrasonic.util.Settings
import org.moire.ultrasonic.util.Util
import timber.log.Timber
import kotlin.coroutines.coroutineContext
private const val MEDIA_ROOT_ID = "MEDIA_ROOT_ID"
private const val MEDIA_ALBUM_ID = "MEDIA_ALBUM_ID"

View File

@ -48,7 +48,10 @@ class MediaNotificationProvider(context: Context) :
tmp.add(
CommandButton.Builder()
.setDisplayName("Love")
.setIconResId(if (rating.isHeart) R.drawable.ic_star_full_dark else R.drawable.ic_star_hollow_dark)
.setIconResId(
if (rating.isHeart) R.drawable.ic_star_full_dark
else R.drawable.ic_star_hollow_dark
)
.setSessionCommand(
SessionCommand(
SESSION_CUSTOM_SET_RATING,

View File

@ -10,11 +10,9 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import androidx.core.net.toUri
import androidx.media3.common.HeartRating
import androidx.media3.common.MediaItem
import androidx.media3.common.MediaItem.RequestMetadata
import androidx.media3.common.MediaMetadata
import androidx.media3.common.Player
import androidx.media3.common.Timeline