Fixed Material Slider crashes

This commit is contained in:
Prathamesh More 2022-05-26 14:52:31 +05:30
parent cee51eb2cc
commit f04bf4c3aa

View file

@ -82,17 +82,9 @@ abstract class AbsPlayerControlsFragment(@LayoutRes layout: Int) : AbsMusicServi
if (seekBar == null) { if (seekBar == null) {
progressSlider?.valueTo = total.toFloat() progressSlider?.valueTo = total.toFloat()
if (isSeeking) { if (progress > total) return
progressSlider?.value = progress.toFloat() progressSlider?.value = progress.toFloat()
} else {
progressAnimator =
ObjectAnimator.ofFloat(progressSlider, "value", progress.toFloat()).apply {
duration = SLIDER_ANIMATION_TIME
interpolator = LinearInterpolator()
start()
}
}
} else { } else {
seekBar?.max = total seekBar?.max = total