Skip to content

Commit e8e2b67

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Further tweak touchMajor/Minor stabilization in ScaleGestureDetector" into jb-mr1-dev
2 parents 9703880 + d736d20 commit e8e2b67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/java/android/view/ScaleGestureDetector.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void onScaleEnd(ScaleGestureDetector detector) {
146146
private int[] mTouchHistoryDirection;
147147
private long[] mTouchHistoryLastAcceptedTime;
148148

149-
private static final long TOUCH_STABILIZE_TIME = 64; // ms
149+
private static final long TOUCH_STABILIZE_TIME = 128; // ms
150150

151151
/**
152152
* Consistency verifier for debugging purposes.
@@ -192,7 +192,8 @@ private void addTouchHistory(MotionEvent ev) {
192192

193193
if (hasLastAccepted) {
194194
final int directionSig = (int) Math.signum(avg - mTouchHistoryLastAccepted[id]);
195-
if (directionSig != mTouchHistoryDirection[id]) {
195+
if (directionSig != mTouchHistoryDirection[id] ||
196+
(directionSig == 0 && mTouchHistoryDirection[id] == 0)) {
196197
mTouchHistoryDirection[id] = directionSig;
197198
final long time = h < historySize ? ev.getHistoricalEventTime(h)
198199
: ev.getEventTime();

0 commit comments

Comments
 (0)