Final lint
This commit is contained in:
parent
d6aebd9989
commit
16b3fcad32
|
@ -756,21 +756,26 @@ class PlayerFragment :
|
||||||
mediaPlayerController.controller?.setRating(
|
mediaPlayerController.controller?.setRating(
|
||||||
HeartRating(!isStarred)
|
HeartRating(!isStarred)
|
||||||
)?.let {
|
)?.let {
|
||||||
Futures.addCallback(it, object : FutureCallback<SessionResult> {
|
Futures.addCallback(
|
||||||
override fun onSuccess(result: SessionResult?) {
|
it,
|
||||||
if (isStarred) {
|
object : FutureCallback<SessionResult> {
|
||||||
starMenuItem.icon = hollowStar
|
override fun onSuccess(result: SessionResult?) {
|
||||||
currentSong!!.starred = false
|
if (isStarred) {
|
||||||
} else {
|
starMenuItem.icon = hollowStar
|
||||||
starMenuItem.icon = fullStar
|
currentSong!!.starred = false
|
||||||
currentSong!!.starred = true
|
} else {
|
||||||
|
starMenuItem.icon = fullStar
|
||||||
|
currentSong!!.starred = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFailure(t: Throwable) {
|
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
|
return true
|
||||||
|
|
|
@ -213,7 +213,6 @@ class AutoMediaBrowserCallback(var player: Player) :
|
||||||
args: Bundle
|
args: Bundle
|
||||||
): ListenableFuture<SessionResult> {
|
): ListenableFuture<SessionResult> {
|
||||||
|
|
||||||
|
|
||||||
var customCommandFuture: ListenableFuture<SessionResult>? = null
|
var customCommandFuture: ListenableFuture<SessionResult>? = null
|
||||||
|
|
||||||
when (customCommand.customAction) {
|
when (customCommand.customAction) {
|
||||||
|
@ -245,7 +244,8 @@ class AutoMediaBrowserCallback(var player: Player) :
|
||||||
LENGTH_SHORT
|
LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
}, MoreExecutors.directExecutor()
|
},
|
||||||
|
MoreExecutors.directExecutor()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -595,15 +595,19 @@ class MediaPlayerController(
|
||||||
HeartRating(!song.starred)
|
HeartRating(!song.starred)
|
||||||
).let {
|
).let {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && it != null) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && it != null) {
|
||||||
Futures.addCallback(it, object : FutureCallback<SessionResult> {
|
Futures.addCallback(
|
||||||
override fun onSuccess(result: SessionResult?) {
|
it,
|
||||||
updateStarred()
|
object : FutureCallback<SessionResult> {
|
||||||
}
|
override fun onSuccess(result: SessionResult?) {
|
||||||
|
updateStarred()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onFailure(t: Throwable) {
|
override fun onFailure(t: Throwable) {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
}, context.mainExecutor)
|
},
|
||||||
|
context.mainExecutor
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
updateStarred()
|
updateStarred()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue