From 048efdf59fd733bae305d98a48e6fc550b7aeb1e Mon Sep 17 00:00:00 2001 From: Koitharu Date: Mon, 3 Oct 2022 08:02:49 +0300 Subject: [PATCH] Fix crash on slider --- app/src/main/java/org/koitharu/kotatsu/utils/ext/ViewExt.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/koitharu/kotatsu/utils/ext/ViewExt.kt b/app/src/main/java/org/koitharu/kotatsu/utils/ext/ViewExt.kt index 18fa66cc2..ffbfb41e6 100644 --- a/app/src/main/java/org/koitharu/kotatsu/utils/ext/ViewExt.kt +++ b/app/src/main/java/org/koitharu/kotatsu/utils/ext/ViewExt.kt @@ -114,7 +114,8 @@ fun RecyclerView.ViewHolder.getItem(clazz: Class): 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