Final lint
This commit is contained in:
parent
d6aebd9989
commit
16b3fcad32
|
@ -756,21 +756,26 @@ class PlayerFragment :
|
|||
mediaPlayerController.controller?.setRating(
|
||||
HeartRating(!isStarred)
|
||||
)?.let {
|
||||
Futures.addCallback(it, object : FutureCallback<SessionResult> {
|
||||
override fun onSuccess(result: SessionResult?) {
|
||||
if (isStarred) {
|
||||
starMenuItem.icon = hollowStar
|
||||
currentSong!!.starred = false
|
||||
} else {
|
||||
starMenuItem.icon = fullStar
|
||||
currentSong!!.starred = true
|
||||
Futures.addCallback(
|
||||
it,
|
||||
object : FutureCallback<SessionResult> {
|
||||
override fun onSuccess(result: SessionResult?) {
|
||||
if (isStarred) {
|
||||
starMenuItem.icon = hollowStar
|
||||
currentSong!!.starred = false
|
||||
} else {
|
||||
starMenuItem.icon = fullStar
|
||||
currentSong!!.starred = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(t: Throwable) {
|
||||
Toast.makeText(context, "SetRating failed", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}, this.executorService)
|
||||
override fun onFailure(t: Throwable) {
|
||||
Toast.makeText(context, "SetRating failed", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
},
|
||||
this.executorService
|
||||
)
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
|
@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -595,15 +595,19 @@ class MediaPlayerController(
|
|||
HeartRating(!song.starred)
|
||||
).let {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && it != null) {
|
||||
Futures.addCallback(it, object : FutureCallback<SessionResult> {
|
||||
override fun onSuccess(result: SessionResult?) {
|
||||
updateStarred()
|
||||
}
|
||||
Futures.addCallback(
|
||||
it,
|
||||
object : FutureCallback<SessionResult> {
|
||||
override fun onSuccess(result: SessionResult?) {
|
||||
updateStarred()
|
||||
}
|
||||
|
||||
override fun onFailure(t: Throwable) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}, context.mainExecutor)
|
||||
override fun onFailure(t: Throwable) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
},
|
||||
context.mainExecutor
|
||||
)
|
||||
} else {
|
||||
updateStarred()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue