Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 63bc5f4

Browse files
committed
[[ Bug 12419 ]] Ensure Android ScrollViews don't cancel touch events
This patch implements the `onInterceptTouchEvent` method in the vertical and horizontal scroll views so that they do not cancel the touch events. Without this patch the cancellation of the touch events causes a touch down to be unpaired with an up or release event. Not that iOS Scrollers have a `canCancelTouches` property but android scrollers do not.
1 parent 21ae79c commit 63bc5f4

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

docs/notes/bugfix-12419.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix touch messages not being sent to controls under an mobile scroller control on Android

engine/src/java/com/runrev/android/nativecontrol/ScrollerControl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public void onScrollChanged(int l, int t, int oldl, int oldt)
8080
ScrollerControl.this.updateScroll(m_dispatching ? m_new_left : m_left, t);
8181
super.onScrollChanged(l, t, oldl, oldt);
8282
}
83+
84+
@Override
85+
public boolean onInterceptTouchEvent (MotionEvent ev)
86+
{
87+
return true;
88+
}
8389
};
8490
m_hscroll = new HorizontalScrollView(p_context) {
8591
@Override
@@ -89,6 +95,12 @@ public void onScrollChanged(int l, int t, int oldl, int oldt)
8995
ScrollerControl.this.updateScroll(l, m_dispatching ? m_new_top : m_top);
9096
super.onScrollChanged(l, t, oldl, oldt);
9197
}
98+
99+
@Override
100+
public boolean onInterceptTouchEvent (MotionEvent ev)
101+
{
102+
return true;
103+
}
92104
};
93105

94106
m_inner_hview = new View(p_context) {

0 commit comments

Comments
 (0)