Fix crash on slider

This commit is contained in:
Koitharu
2022-10-03 08:02:49 +03:00
parent 627a00beb4
commit 65dbc6b8e5

View File

@@ -127,7 +127,8 @@ fun <T> RecyclerView.ViewHolder.getItem(clazz: Class<T>): T? {
fun Slider.setValueRounded(newValue: Float) {
val step = stepSize
value = (newValue / step).roundToInt() * step
val roundedValue = (newValue / step).roundToInt() * step
value = roundedValue.coerceIn(valueFrom, valueTo)
}
val RecyclerView.isScrolledToTop: Boolean