playback: fix playback progress bug

Fix an issue where I forgot to call executePendingBindings when
updating progress, resulting in strange behavior with the progress
bar.
This commit is contained in:
OxygenCobalt 2021-10-31 19:52:59 -06:00
parent b50a23a47f
commit efb800ee6a
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 1 additions and 6 deletions

View file

@ -66,7 +66,6 @@ class MainFragment : Fragment(), PlaybackBarLayout.ActionCallback {
binding.lifecycleOwner = viewLifecycleOwner
// --- VIEWMODEL SETUP ---
binding.mainBarLayout.setActionCallback(this)
binding.mainBarLayout.setSong(playbackModel.song.value)

View file

@ -84,6 +84,7 @@ class CompactPlaybackView @JvmOverloads constructor(
fun setSong(song: Song) {
binding.song = song
binding.executePendingBindings()
}
fun setPlaying(isPlaying: Boolean) {
@ -91,11 +92,6 @@ class CompactPlaybackView @JvmOverloads constructor(
}
fun setPosition(position: Long) {
if (binding.song == null) {
binding.playbackProgressBar.progress = 0
return
}
binding.playbackProgressBar.progress = position.toInt()
}