Loading core/java/android/widget/HorizontalScrollView.java +22 −5 Original line number Diff line number Diff line Loading @@ -536,10 +536,15 @@ public class HorizontalScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { mIsBeingDragged = getChildCount() != 0; if (!mIsBeingDragged) { if (getChildCount() == 0) { return false; } if ((mIsBeingDragged = !mScroller.isFinished())) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } /* * If being flinged and user touches, stop the fling. isFinished Loading @@ -555,11 +560,23 @@ public class HorizontalScrollView extends FrameLayout { break; } case MotionEvent.ACTION_MOVE: if (mIsBeingDragged) { // Scroll to follow the motion event final int activePointerIndex = ev.findPointerIndex(mActivePointerId); final int x = (int) ev.getX(activePointerIndex); final int deltaX = (int) (mLastMotionX - x); int deltaX = mLastMotionX - x; if (!mIsBeingDragged && Math.abs(deltaX) > mTouchSlop) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } mIsBeingDragged = true; if (deltaX > 0) { deltaX -= mTouchSlop; } else { deltaX += mTouchSlop; } } if (mIsBeingDragged) { // Scroll to follow the motion event mLastMotionX = x; final int oldX = mScrollX; Loading core/java/android/widget/ScrollView.java +26 −5 Original line number Diff line number Diff line Loading @@ -482,6 +482,10 @@ public class ScrollView extends FrameLayout { if (mScrollStrictSpan == null) { mScrollStrictSpan = StrictMode.enterCriticalSpan("ScrollView-scroll"); } final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } break; } Loading Loading @@ -546,10 +550,15 @@ public class ScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { mIsBeingDragged = getChildCount() != 0; if (!mIsBeingDragged) { if (getChildCount() == 0) { return false; } if ((mIsBeingDragged = !mScroller.isFinished())) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } /* * If being flinged and user touches, stop the fling. isFinished Loading @@ -569,11 +578,23 @@ public class ScrollView extends FrameLayout { break; } case MotionEvent.ACTION_MOVE: if (mIsBeingDragged) { // Scroll to follow the motion event final int activePointerIndex = ev.findPointerIndex(mActivePointerId); final int y = (int) ev.getY(activePointerIndex); final int deltaY = mLastMotionY - y; int deltaY = mLastMotionY - y; if (!mIsBeingDragged && Math.abs(deltaY) > mTouchSlop) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } mIsBeingDragged = true; if (deltaY > 0) { deltaY -= mTouchSlop; } else { deltaY += mTouchSlop; } } if (mIsBeingDragged) { // Scroll to follow the motion event mLastMotionY = y; final int oldX = mScrollX; Loading Loading
core/java/android/widget/HorizontalScrollView.java +22 −5 Original line number Diff line number Diff line Loading @@ -536,10 +536,15 @@ public class HorizontalScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { mIsBeingDragged = getChildCount() != 0; if (!mIsBeingDragged) { if (getChildCount() == 0) { return false; } if ((mIsBeingDragged = !mScroller.isFinished())) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } /* * If being flinged and user touches, stop the fling. isFinished Loading @@ -555,11 +560,23 @@ public class HorizontalScrollView extends FrameLayout { break; } case MotionEvent.ACTION_MOVE: if (mIsBeingDragged) { // Scroll to follow the motion event final int activePointerIndex = ev.findPointerIndex(mActivePointerId); final int x = (int) ev.getX(activePointerIndex); final int deltaX = (int) (mLastMotionX - x); int deltaX = mLastMotionX - x; if (!mIsBeingDragged && Math.abs(deltaX) > mTouchSlop) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } mIsBeingDragged = true; if (deltaX > 0) { deltaX -= mTouchSlop; } else { deltaX += mTouchSlop; } } if (mIsBeingDragged) { // Scroll to follow the motion event mLastMotionX = x; final int oldX = mScrollX; Loading
core/java/android/widget/ScrollView.java +26 −5 Original line number Diff line number Diff line Loading @@ -482,6 +482,10 @@ public class ScrollView extends FrameLayout { if (mScrollStrictSpan == null) { mScrollStrictSpan = StrictMode.enterCriticalSpan("ScrollView-scroll"); } final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } break; } Loading Loading @@ -546,10 +550,15 @@ public class ScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { mIsBeingDragged = getChildCount() != 0; if (!mIsBeingDragged) { if (getChildCount() == 0) { return false; } if ((mIsBeingDragged = !mScroller.isFinished())) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } /* * If being flinged and user touches, stop the fling. isFinished Loading @@ -569,11 +578,23 @@ public class ScrollView extends FrameLayout { break; } case MotionEvent.ACTION_MOVE: if (mIsBeingDragged) { // Scroll to follow the motion event final int activePointerIndex = ev.findPointerIndex(mActivePointerId); final int y = (int) ev.getY(activePointerIndex); final int deltaY = mLastMotionY - y; int deltaY = mLastMotionY - y; if (!mIsBeingDragged && Math.abs(deltaY) > mTouchSlop) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } mIsBeingDragged = true; if (deltaY > 0) { deltaY -= mTouchSlop; } else { deltaY += mTouchSlop; } } if (mIsBeingDragged) { // Scroll to follow the motion event mLastMotionY = y; final int oldX = mScrollX; Loading