Skip to content

Commit b1861c3

Browse files
committed
Minor fixes/clarifications for previous patch.
Change-Id: Ib44f6de570064b3f3ddf70b6727b479a09ae5d7a
1 parent b45965f commit b1861c3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

core/java/android/view/ScaleGestureDetector.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ public boolean onTouchEvent(MotionEvent event) {
213213
for (int i = 0; i < count; i++) {
214214
if (skipIndex == i) continue;
215215

216-
// touchMajor/Minor are axes of an ellipse; average them together and
217-
// convert the resulting 'diameter' into a radius.
216+
// Average touch major and touch minor and convert the resulting diameter into a radius.
218217
final float touchSize = (event.getTouchMajor(i) + event.getTouchMinor(i)) / 4;
219218
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
220219
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
@@ -245,7 +244,7 @@ public boolean onTouchEvent(MotionEvent event) {
245244
mPrevSpanY = mCurrSpanY = spanY;
246245
mInitialSpan = mPrevSpan = mCurrSpan = span;
247246
}
248-
if (!mInProgress && span > mMinSpan &&
247+
if (!mInProgress && span >= mMinSpan &&
249248
(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
250249
mPrevSpanX = mCurrSpanX = spanX;
251250
mPrevSpanY = mCurrSpanY = spanY;

core/res/res/values/config.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,14 @@
927927
<integer name="config_multiuserMaximumUsers">1</integer>
928928

929929
<!-- Minimum span needed to begin a touch scaling gesture.
930+
If the span is equal to or greater than this size, a scaling gesture
931+
will begin, where supported. (See android.view.ScaleGestureDetector)
932+
930933
This also takes into account the size of any active touch points.
931934
Devices with screens that deviate too far from their assigned density
932-
bucket should consider tuning this value in a device-specific overlay. -->
935+
bucket should consider tuning this value in a device-specific overlay.
936+
For best results, care should be taken such that this value remains
937+
larger than the minimum reported touchMajor/touchMinor values
938+
reported by the hardware. -->
933939
<dimen name="config_minScalingSpan">25mm</dimen>
934940
</resources>

0 commit comments

Comments
 (0)