diff options
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt index 9041c90..00aa33d 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt @@ -202,13 +202,20 @@ class SwipeBackLayout @JvmOverloads constructor(context: Context, attrs: Attribu override fun onInterceptTouchEvent(event: MotionEvent): Boolean { if (!swipeEnabled || disallowIntercept) return false - val s = dragHelper.shouldInterceptTouchEvent(event) - return s + try { + return dragHelper.shouldInterceptTouchEvent(event) + } catch (e: Exception) { + return false + } } override fun onTouchEvent(event: MotionEvent): Boolean { if (!swipeEnabled) return false - dragHelper.processTouchEvent(event) + try { + dragHelper.processTouchEvent(event) + } catch (e: Exception) { + return false + } return true } |