summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2012-10-03 07:01:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-03 07:01:28 -0700
commit69ea898b8e1edcf5afc4a9194eacbd1cc0177ca5 (patch)
tree0fb64eec8269941e7abe5bad4ac4f75c79c745d9
parentf21642366c0d05ea9f1d18d3e67cd726cb845ae8 (diff)
parent029e147b33e99d28f3aa70105eff8ed684bdefe0 (diff)
downloadCalendar-69ea898b8e1edcf5afc4a9194eacbd1cc0177ca5.tar.gz
am 029e147b: am 4dcabc96: Added touch slop for horizontal scrolling
* commit '029e147b33e99d28f3aa70105eff8ed684bdefe0': Added touch slop for horizontal scrolling
-rw-r--r--src/com/android/calendar/DayView.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/calendar/DayView.java b/src/com/android/calendar/DayView.java
index cd32f354..d636b8ab 100644
--- a/src/com/android/calendar/DayView.java
+++ b/src/com/android/calendar/DayView.java
@@ -471,6 +471,7 @@ public class DayView extends View implements View.OnCreateContextMenuListener,
private static int mMinCellHeight = 32;
private int mScrollStartY;
private int mPreviousDirection;
+ private static int mScaledPagingTouchSlop = 0;
/**
* Vertical distance or span between the two touch points at the start of a
@@ -768,6 +769,7 @@ public class DayView extends View implements View.OnCreateContextMenuListener,
mEdgeEffectTop = new EdgeEffect(context);
mEdgeEffectBottom = new EdgeEffect(context);
ViewConfiguration vc = ViewConfiguration.get(context);
+ mScaledPagingTouchSlop = vc.getScaledPagingTouchSlop();
mOnDownDelay = ViewConfiguration.getTapTimeout();
OVERFLING_DISTANCE = vc.getScaledOverflingDistance();
@@ -3990,9 +3992,12 @@ public class DayView extends View implements View.OnCreateContextMenuListener,
mPreviousDirection = 0;
if (absDistanceX > absDistanceY) {
- mTouchMode = TOUCH_MODE_HSCROLL;
- mViewStartX = distanceX;
- initNextView(-mViewStartX);
+ int slopFactor = mScaleGestureDetector.isInProgress() ? 20 : 2;
+ if (absDistanceX > mScaledPagingTouchSlop * slopFactor) {
+ mTouchMode = TOUCH_MODE_HSCROLL;
+ mViewStartX = distanceX;
+ initNextView(-mViewStartX);
+ }
} else {
mTouchMode = TOUCH_MODE_VSCROLL;
}