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() {
168168 * <li>if event is up, start auto scroll again.</li>
169169 * </ul>
170170 */
171- @ Override
172- public boolean onTouchEvent (MotionEvent ev ) {
171+ @ Override
172+ public boolean dispatchTouchEvent (MotionEvent ev ) {
173+ int action = MotionEventCompat .getActionMasked (ev );
174+
173175 if (stopScrollWhenTouch ) {
174- if (ev . getAction () == MotionEvent .ACTION_DOWN && isAutoScroll ) {
176+ if (( action == MotionEvent .ACTION_DOWN ) && isAutoScroll ) {
175177 isStopByTouch = true ;
176178 stopAutoScroll ();
177179 } else if (ev .getAction () == MotionEvent .ACTION_UP && isStopByTouch ) {
@@ -202,11 +204,12 @@ public boolean onTouchEvent(MotionEvent ev) {
202204 }
203205 getParent ().requestDisallowInterceptTouchEvent (true );
204206 }
205- return super .onTouchEvent (ev );
207+ return super .dispatchTouchEvent (ev );
206208 }
207209 }
208210 getParent ().requestDisallowInterceptTouchEvent (true );
209- return super .onTouchEvent (ev );
211+
212+ return super .dispatchTouchEvent (ev );
210213 }
211214
212215 private class MyHandler extends Handler {
You can’t perform that action at this time.
0 commit comments