mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
apply patch
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
b9855e8a86
commit
d8ed2ce5c7
2 changed files with 7 additions and 7 deletions
|
@ -113,7 +113,7 @@ class BackgroundPlayerService : MediaSessionService(), Injectable {
|
|||
.setDisplayName("PlayPause")
|
||||
.setIconResId(
|
||||
CommandButton.getIconResIdForIconConstant(
|
||||
if (mediaSession?.player?.isPlaying!!) {
|
||||
if (mediaSession?.player?.isPlaying == true) {
|
||||
CommandButton.ICON_PAUSE
|
||||
} else {
|
||||
CommandButton.ICON_PLAY
|
||||
|
@ -215,7 +215,7 @@ class BackgroundPlayerService : MediaSessionService(), Injectable {
|
|||
|
||||
private fun release() {
|
||||
val player = mediaSession?.player
|
||||
if (player!!.playWhenReady) {
|
||||
if (player?.playWhenReady == true) {
|
||||
// Make sure the service is not in foreground.
|
||||
player.pause()
|
||||
}
|
||||
|
|
|
@ -100,14 +100,14 @@ class MediaControlView(context: Context, attrs: AttributeSet?) :
|
|||
*/
|
||||
private fun disableUnsupportedButtons() {
|
||||
try {
|
||||
if (playerControl!!.isCommandAvailable(Player.COMMAND_PLAY_PAUSE).not()) {
|
||||
if (playerControl?.isCommandAvailable(Player.COMMAND_PLAY_PAUSE)?.not() == true) {
|
||||
binding.playBtn.isEnabled = false
|
||||
}
|
||||
|
||||
if (playerControl!!.isCommandAvailable(Player.COMMAND_SEEK_BACK).not()) {
|
||||
if (playerControl?.isCommandAvailable(Player.COMMAND_SEEK_BACK)?.not() == true) {
|
||||
binding.rewindBtn.isEnabled = false
|
||||
}
|
||||
if (playerControl!!.isCommandAvailable(Player.COMMAND_SEEK_FORWARD).not()) {
|
||||
if (playerControl?.isCommandAvailable(Player.COMMAND_SEEK_FORWARD)?.not() == true) {
|
||||
binding.forwardBtn.isEnabled = false
|
||||
}
|
||||
} catch (ex: IncompatibleClassChangeError) {
|
||||
|
@ -234,12 +234,12 @@ class MediaControlView(context: Context, attrs: AttributeSet?) :
|
|||
R.drawable.ic_play
|
||||
}
|
||||
)
|
||||
binding.forwardBtn.visibility = if (playerControl!!.isCommandAvailable(Player.COMMAND_SEEK_FORWARD)) {
|
||||
binding.forwardBtn.visibility = if (playerControl?.isCommandAvailable(Player.COMMAND_SEEK_FORWARD) == true) {
|
||||
VISIBLE
|
||||
} else {
|
||||
INVISIBLE
|
||||
}
|
||||
binding.rewindBtn.visibility = if (playerControl!!.isCommandAvailable(Player.COMMAND_SEEK_BACK)) {
|
||||
binding.rewindBtn.visibility = if (playerControl?.isCommandAvailable(Player.COMMAND_SEEK_BACK) == true) {
|
||||
VISIBLE
|
||||
} else {
|
||||
INVISIBLE
|
||||
|
|
Loading…
Reference in a new issue