diff --git a/library/src/main/kotlin/me/thanel/swipeactionview/SwipeActionView.kt b/library/src/main/kotlin/me/thanel/swipeactionview/SwipeActionView.kt index 570db50..6d2a6e1 100644 --- a/library/src/main/kotlin/me/thanel/swipeactionview/SwipeActionView.kt +++ b/library/src/main/kotlin/me/thanel/swipeactionview/SwipeActionView.kt @@ -518,10 +518,6 @@ class SwipeActionView : FrameLayout { prepareDrag(e) } - MotionEvent.ACTION_MOVE -> { - return handleMoveEvent(e) - } - MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { cancelDrag() @@ -529,8 +525,7 @@ class SwipeActionView : FrameLayout { } } - // In most cases we don't want to handle touch events alone. We give child views a chance to - // intercept them. + // Give child views a chance to intercept touch events before this view. return false } @@ -539,6 +534,12 @@ class SwipeActionView : FrameLayout { MotionEvent.ACTION_DOWN -> { prepareDrag(e) prepareMessages(e) + + // Stop the animator to allow "catching" of view. + // By "catching" I mean the possibility for user to click on the view and continue swiping + // from the position at which it was when starting new swipe. + animator.cancel() + return true } @@ -612,11 +613,6 @@ class SwipeActionView : FrameLayout { initialRawX = e.rawX initialRawY = e.rawY - // Stop the animator to allow "catching" of view. - // By "catching" I mean the possibility for user to click on the view and continue swiping - // from the position at which it was when starting new swipe. - animator.cancel() - handler.removeOurMessages() } diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index a367e17..3df2ce6 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -212,5 +212,7 @@ app:cardElevation="10dp" /> + + diff --git a/sample/src/main/res/layout/item_with_horizontal_scroll_view.xml b/sample/src/main/res/layout/item_with_horizontal_scroll_view.xml new file mode 100644 index 0000000..809d2b4 --- /dev/null +++ b/sample/src/main/res/layout/item_with_horizontal_scroll_view.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + +