diff options
author | Michael Chan <mchan@android.com> | 2012-10-03 07:00:28 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-03 07:00:28 -0700 |
commit | 029e147b33e99d28f3aa70105eff8ed684bdefe0 (patch) | |
tree | 217c7b5abdd68e3a661660dbc818a23c4466717d /src | |
parent | 25f84790f8df9217c33dbb098776c5e429501731 (diff) | |
parent | 4dcabc96044eb83be2320e753fee9b1dc266ec32 (diff) | |
download | android_packages_apps_Calendar-029e147b33e99d28f3aa70105eff8ed684bdefe0.tar.gz android_packages_apps_Calendar-029e147b33e99d28f3aa70105eff8ed684bdefe0.tar.bz2 android_packages_apps_Calendar-029e147b33e99d28f3aa70105eff8ed684bdefe0.zip |
am 4dcabc96: Added touch slop for horizontal scrolling
* commit '4dcabc96044eb83be2320e753fee9b1dc266ec32':
Added touch slop for horizontal scrolling
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/calendar/DayView.java | 11 |
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; } |