Merge "Never drag scroll views with no children. (DO NOT MERGE)" into gingerbread
This commit is contained in:
@@ -502,8 +502,10 @@ public class HorizontalScrollView extends FrameLayout {
|
|||||||
|
|
||||||
switch (action & MotionEvent.ACTION_MASK) {
|
switch (action & MotionEvent.ACTION_MASK) {
|
||||||
case MotionEvent.ACTION_DOWN: {
|
case MotionEvent.ACTION_DOWN: {
|
||||||
final float x = ev.getX();
|
mIsBeingDragged = getChildCount() != 0;
|
||||||
mIsBeingDragged = true;
|
if (!mIsBeingDragged) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If being flinged and user touches, stop the fling. isFinished
|
* If being flinged and user touches, stop the fling. isFinished
|
||||||
@@ -514,7 +516,7 @@ public class HorizontalScrollView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remember where the motion event started
|
// Remember where the motion event started
|
||||||
mLastMotionX = x;
|
mLastMotionX = ev.getX();
|
||||||
mActivePointerId = ev.getPointerId(0);
|
mActivePointerId = ev.getPointerId(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -497,9 +497,11 @@ public class ScrollView extends FrameLayout {
|
|||||||
|
|
||||||
switch (action & MotionEvent.ACTION_MASK) {
|
switch (action & MotionEvent.ACTION_MASK) {
|
||||||
case MotionEvent.ACTION_DOWN: {
|
case MotionEvent.ACTION_DOWN: {
|
||||||
final float y = ev.getY();
|
mIsBeingDragged = getChildCount() != 0;
|
||||||
mIsBeingDragged = true;
|
if (!mIsBeingDragged) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If being flinged and user touches, stop the fling. isFinished
|
* If being flinged and user touches, stop the fling. isFinished
|
||||||
* will be false if being flinged.
|
* will be false if being flinged.
|
||||||
@@ -509,7 +511,7 @@ public class ScrollView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remember where the motion event started
|
// Remember where the motion event started
|
||||||
mLastMotionY = y;
|
mLastMotionY = ev.getY();
|
||||||
mActivePointerId = ev.getPointerId(0);
|
mActivePointerId = ev.getPointerId(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user