From 65dbc6b8e526e2c04fe4c589341bec0631105203 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 12b2abe7b..29d0953c7 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 @@ -127,7 +127,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