File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/cn/trinea/android/view/autoscrollviewpager Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -168,10 +168,12 @@ public void scrollOnce() {
168
168
* <li>if event is up, start auto scroll again.</li>
169
169
* </ul>
170
170
*/
171
- @ Override
172
- public boolean onTouchEvent (MotionEvent ev ) {
171
+ @ Override
172
+ public boolean dispatchTouchEvent (MotionEvent ev ) {
173
+ int action = MotionEventCompat .getActionMasked (ev );
174
+
173
175
if (stopScrollWhenTouch ) {
174
- if (ev . getAction () == MotionEvent .ACTION_DOWN && isAutoScroll ) {
176
+ if (( action == MotionEvent .ACTION_DOWN ) && isAutoScroll ) {
175
177
isStopByTouch = true ;
176
178
stopAutoScroll ();
177
179
} else if (ev .getAction () == MotionEvent .ACTION_UP && isStopByTouch ) {
@@ -202,11 +204,12 @@ public boolean onTouchEvent(MotionEvent ev) {
202
204
}
203
205
getParent ().requestDisallowInterceptTouchEvent (true );
204
206
}
205
- return super .onTouchEvent (ev );
207
+ return super .dispatchTouchEvent (ev );
206
208
}
207
209
}
208
210
getParent ().requestDisallowInterceptTouchEvent (true );
209
- return super .onTouchEvent (ev );
211
+
212
+ return super .dispatchTouchEvent (ev );
210
213
}
211
214
212
215
private class MyHandler extends Handler {
You can’t perform that action at this time.
0 commit comments