Skip to content

Commit

Permalink
[Android] Bug fix: Touchables in Interactable.View work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
woodpav committed Nov 1, 2018
1 parent 6b17ea3 commit d169000
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {

this.isSwiping = this.isSwiping || isHSwipe || isVSwipe;

if (!isChildIsScrollContainer && dragEnabled && (horizontalOnly && isHSwipe ||
if (this.isSwiping && !isChildIsScrollContainer && dragEnabled &&
(horizontalOnly && isHSwipe ||
verticalOnly && isVSwipe ||
!horizontalOnly && !verticalOnly)) {

Expand Down

1 comment on commit d169000

@woodpav
Copy link
Owner Author

@woodpav woodpav commented on d169000 Nov 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.isSwiping is a boolean in InteractableView.java. It is set to true at the start of a touch that is either horizontal or vertical (determined by the system hitSlop). I added this.isSwiping into the drag event detection so that your finger must move out of the hitSlop to trigger the drag (and thus capture the touch from Touchables). If you set verticalOnly or horziontalOnly to true you wouldn't experience the issue. It worked when you tapped delicately because that was a ACTION_DOWN not a ACTION_MOVE.

wix-incubator#187

Please sign in to comment.