From c355e1eb1a92777039761dbd76a73ac118a4c16f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Jul 2018 12:12:22 +0200 Subject: [PATCH] fix a crash at setting fastscroller position --- build.gradle | 2 +- .../commons/views/FastScroller.kt | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 4b29b3768..12591cfd5 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 - propVersionName = '4.3.13' + propVersionName = '4.3.15' kotlin_version = '1.2.50' support_libs = '27.1.1' } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt index e9ff37a80..d56c721ee 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/FastScroller.kt @@ -258,12 +258,15 @@ class FastScroller : FrameLayout { } MotionEvent.ACTION_MOVE -> { if (isScrollingEnabled) { - if (isHorizontal) { - setPosition(event.x) - setRecyclerViewPosition(event.x) - } else { - setPosition(event.y) - setRecyclerViewPosition(event.y) + try { + if (isHorizontal) { + setPosition(event.x) + setRecyclerViewPosition(event.x) + } else { + setPosition(event.y) + setRecyclerViewPosition(event.y) + } + } catch (ignored: Exception) { } } true