Final lint

This commit is contained in:
Maxence G 2022-07-02 21:58:45 +02:00
parent d6aebd9989
commit 16b3fcad32
No known key found for this signature in database
GPG Key ID: DC1FD9409E3FE284
3 changed files with 32 additions and 23 deletions

View File

@ -756,7 +756,9 @@ class PlayerFragment :
mediaPlayerController.controller?.setRating(
HeartRating(!isStarred)
)?.let {
Futures.addCallback(it, object : FutureCallback<SessionResult> {
Futures.addCallback(
it,
object : FutureCallback<SessionResult> {
override fun onSuccess(result: SessionResult?) {
if (isStarred) {
starMenuItem.icon = hollowStar
@ -768,9 +770,12 @@ class PlayerFragment :
}
override fun onFailure(t: Throwable) {
Toast.makeText(context, "SetRating failed", Toast.LENGTH_SHORT).show()
Toast.makeText(context, "SetRating failed", Toast.LENGTH_SHORT)
.show()
}
}, this.executorService)
},
this.executorService
)
}
return true

View File

@ -213,7 +213,6 @@ class AutoMediaBrowserCallback(var player: Player) :
args: Bundle
): ListenableFuture<SessionResult> {
var customCommandFuture: ListenableFuture<SessionResult>? = null
when (customCommand.customAction) {
@ -245,7 +244,8 @@ class AutoMediaBrowserCallback(var player: Player) :
LENGTH_SHORT
).show()
}
}, MoreExecutors.directExecutor()
},
MoreExecutors.directExecutor()
)
}
}

View File

@ -595,7 +595,9 @@ class MediaPlayerController(
HeartRating(!song.starred)
).let {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && it != null) {
Futures.addCallback(it, object : FutureCallback<SessionResult> {
Futures.addCallback(
it,
object : FutureCallback<SessionResult> {
override fun onSuccess(result: SessionResult?) {
updateStarred()
}
@ -603,7 +605,9 @@ class MediaPlayerController(
override fun onFailure(t: Throwable) {
TODO("Not yet implemented")
}
}, context.mainExecutor)
},
context.mainExecutor
)
} else {
updateStarred()
}