summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2012-09-16 12:04:39 -0700
committerAdam Powell <adamp@google.com>2012-09-16 12:17:53 -0700
commitb1861c3e89c3e869c95c5c01b78320a1dcef26ad (patch)
treea61e1d2ab12b0b67e80843f9e8ee0f2f56a41628
parentb45965f519d41f138f0d0edfb587e4861e2199f4 (diff)
downloadframeworks_base-b1861c3e89c3e869c95c5c01b78320a1dcef26ad.zip
frameworks_base-b1861c3e89c3e869c95c5c01b78320a1dcef26ad.tar.gz
frameworks_base-b1861c3e89c3e869c95c5c01b78320a1dcef26ad.tar.bz2
Minor fixes/clarifications for previous patch.
Change-Id: Ib44f6de570064b3f3ddf70b6727b479a09ae5d7a
-rw-r--r--core/java/android/view/ScaleGestureDetector.java5
-rwxr-xr-xcore/res/res/values/config.xml8
2 files changed, 9 insertions, 4 deletions
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 7d89680..fa03139 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -213,8 +213,7 @@ public class ScaleGestureDetector {
for (int i = 0; i < count; i++) {
if (skipIndex == i) continue;
- // touchMajor/Minor are axes of an ellipse; average them together and
- // convert the resulting 'diameter' into a radius.
+ // Average touch major and touch minor and convert the resulting diameter into a radius.
final float touchSize = (event.getTouchMajor(i) + event.getTouchMinor(i)) / 4;
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
@@ -245,7 +244,7 @@ public class ScaleGestureDetector {
mPrevSpanY = mCurrSpanY = spanY;
mInitialSpan = mPrevSpan = mCurrSpan = span;
}
- if (!mInProgress && span > mMinSpan &&
+ if (!mInProgress && span >= mMinSpan &&
(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
mPrevSpanX = mCurrSpanX = spanX;
mPrevSpanY = mCurrSpanY = spanY;
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index c97c214..93d7fcc 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -927,8 +927,14 @@
<integer name="config_multiuserMaximumUsers">1</integer>
<!-- Minimum span needed to begin a touch scaling gesture.
+ If the span is equal to or greater than this size, a scaling gesture
+ will begin, where supported. (See android.view.ScaleGestureDetector)
+
This also takes into account the size of any active touch points.
Devices with screens that deviate too far from their assigned density
- bucket should consider tuning this value in a device-specific overlay. -->
+ bucket should consider tuning this value in a device-specific overlay.
+ For best results, care should be taken such that this value remains
+ larger than the minimum reported touchMajor/touchMinor values
+ reported by the hardware. -->
<dimen name="config_minScalingSpan">25mm</dimen>
</resources>