Skip to content

Commit d736d20

Browse files
committed
Further tweak touchMajor/Minor stabilization in ScaleGestureDetector
Change-Id: Ifa717c7dee96c5a2eb18a414a257f01762365b00
1 parent b4693e2 commit d736d20

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)