improve buttonNextEp hiding behaviour
* the button will be diabled on PlayerActivity.playNextEpisode() * the button will only be enabled if PlayerViewModel.playNextEpisode() returns * remainingTime will be set to 0, if duration < 0, this fixes the button reapring after a few 100 ms when beeing pressed fixes #53
This commit is contained in:
parent
f128efea0d
commit
85b17d7a76
|
@ -302,6 +302,8 @@ class PlayerActivity : AppCompatActivity() {
|
|||
if (model.player.duration > 0) {
|
||||
remainingTime = model.player.duration - currentPosition
|
||||
remainingTime = if (remainingTime < 0) 0 else remainingTime
|
||||
} else {
|
||||
remainingTime = 0
|
||||
}
|
||||
|
||||
// TODO add metaDB ending_start support
|
||||
|
@ -428,8 +430,16 @@ class PlayerActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
private fun playNextEpisode() {
|
||||
model.playNextEpisode()
|
||||
// disable the next episode buttons, so a user can't double click it
|
||||
playerBinding.buttonNextEp.isClickable = false
|
||||
controlsBinding.buttonNextEpC.isClickable = false
|
||||
|
||||
hideButtonNextEp()
|
||||
model.playNextEpisode()
|
||||
|
||||
// enable the next episode buttons when playNextEpisode() has returned
|
||||
playerBinding.buttonNextEp.isClickable = true
|
||||
controlsBinding.buttonNextEpC.isClickable = true
|
||||
}
|
||||
|
||||
private fun skipOpening() {
|
||||
|
|
Loading…
Reference in New Issue