diff options
| author | Jeff Brown <jeffbrown@google.com> | 2011-07-14 22:32:09 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-14 22:32:09 -0700 |
| commit | 997ea74ef78139b29ab2a0250aa243e6d96d8dfd (patch) | |
| tree | 28e0cd51127aee18525f014baf814343843e345a /core/java | |
| parent | 945caeeaa8f5dfacdb878239e0bfa8c9d11d9339 (diff) | |
| parent | a6111377e1edbc5d63fc2a7205d58b2d9c21d978 (diff) | |
Merge "Remove edge slop support."
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/ViewAncestor.java | 45 | ||||
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 8 | ||||
| -rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 7 | ||||
| -rw-r--r-- | core/java/android/widget/ListView.java | 11 | ||||
| -rw-r--r-- | core/java/android/widget/ScrollView.java | 7 |
5 files changed, 0 insertions, 78 deletions
diff --git a/core/java/android/view/ViewAncestor.java b/core/java/android/view/ViewAncestor.java index 2ab5a98f2c3f..d539a03b4eda 100644 --- a/core/java/android/view/ViewAncestor.java +++ b/core/java/android/view/ViewAncestor.java @@ -2684,51 +2684,6 @@ public final class ViewAncestor extends Handler implements ViewParent, return; } - // Apply edge slop and try again, if appropriate. - final int edgeFlags = event.getEdgeFlags(); - if (edgeFlags != 0 && mView instanceof ViewGroup) { - final int edgeSlop = mViewConfiguration.getScaledEdgeSlop(); - int direction = View.FOCUS_UP; - int x = (int)event.getX(); - int y = (int)event.getY(); - final int[] deltas = new int[2]; - - if ((edgeFlags & MotionEvent.EDGE_TOP) != 0) { - direction = View.FOCUS_DOWN; - if ((edgeFlags & MotionEvent.EDGE_LEFT) != 0) { - deltas[0] = edgeSlop; - x += edgeSlop; - } else if ((edgeFlags & MotionEvent.EDGE_RIGHT) != 0) { - deltas[0] = -edgeSlop; - x -= edgeSlop; - } - } else if ((edgeFlags & MotionEvent.EDGE_BOTTOM) != 0) { - direction = View.FOCUS_UP; - if ((edgeFlags & MotionEvent.EDGE_LEFT) != 0) { - deltas[0] = edgeSlop; - x += edgeSlop; - } else if ((edgeFlags & MotionEvent.EDGE_RIGHT) != 0) { - deltas[0] = -edgeSlop; - x -= edgeSlop; - } - } else if ((edgeFlags & MotionEvent.EDGE_LEFT) != 0) { - direction = View.FOCUS_RIGHT; - } else if ((edgeFlags & MotionEvent.EDGE_RIGHT) != 0) { - direction = View.FOCUS_LEFT; - } - - View nearest = FocusFinder.getInstance().findNearestTouchable( - ((ViewGroup) mView), x, y, direction, deltas); - if (nearest != null) { - event.offsetLocation(deltas[0], deltas[1]); - event.setEdgeFlags(0); - if (mView.dispatchPointerEvent(event)) { - finishMotionEvent(event, sendDone, true); - return; - } - } - } - // Pointer event was unhandled. finishMotionEvent(event, sendDone, false); } diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 1e10a71a4ab0..2423cd1e3341 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2840,14 +2840,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { - if (ev.getEdgeFlags() != 0 && motionPosition < 0) { - // If we couldn't find a view to click on, but the down event - // was touching the edge, we will bail out and try again. - // This allows the edge correcting code in ViewAncestor to try to - // find a nearby view to select - return false; - } - if (mTouchMode == TOUCH_MODE_FLING) { // Stopped a fling. It is a scroll. createScrollingCache(); diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 7c9be1e8755e..b428301bfaef 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -498,13 +498,6 @@ public class HorizontalScrollView extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent ev) { - - if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) { - // Don't handle edge touches immediately -- they may actually belong to one of our - // descendants. - return false; - } - if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index e7a9e41fb1c2..1f29b1614006 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -3588,17 +3588,6 @@ public class ListView extends AbsListView { return null; } - @Override - public boolean onTouchEvent(MotionEvent ev) { - //noinspection SimplifiableIfStatement - if (mItemsCanFocus && ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) { - // Don't handle edge touches immediately -- they may actually belong to one of our - // descendants. - return false; - } - return super.onTouchEvent(ev); - } - /** * Returns the set of checked items ids. The result is only valid if the * choice mode has not been set to {@link #CHOICE_MODE_NONE}. diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 12775a49ff3a..191410bf3624 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -506,13 +506,6 @@ public class ScrollView extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent ev) { - - if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) { - // Don't handle edge touches immediately -- they may actually belong to one of our - // descendants. - return false; - } - if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } |
