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:54:49 -06:00
parent b50a23a47f
commit efb800ee6a
2 changed files with 1 additions and 6 deletions
@@ -66,7 +66,6 @@ class MainFragment : Fragment(), PlaybackBarLayout.ActionCallback {
binding.lifecycleOwner = viewLifecycleOwner
// --- VIEWMODEL SETUP ---
binding.mainBarLayout.setActionCallback(this)
binding.mainBarLayout.setSong(playbackModel.song.value)
@@ -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()
}