am b1861c3e: Minor fixes/clarifications for previous patch.
* commit 'b1861c3e89c3e869c95c5c01b78320a1dcef26ad': Minor fixes/clarifications for previous patch.
This commit is contained in:
@@ -213,8 +213,7 @@ public class ScaleGestureDetector {
|
|||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
if (skipIndex == i) continue;
|
if (skipIndex == i) continue;
|
||||||
|
|
||||||
// touchMajor/Minor are axes of an ellipse; average them together and
|
// Average touch major and touch minor and convert the resulting diameter into a radius.
|
||||||
// convert the resulting 'diameter' into a radius.
|
|
||||||
final float touchSize = (event.getTouchMajor(i) + event.getTouchMinor(i)) / 4;
|
final float touchSize = (event.getTouchMajor(i) + event.getTouchMinor(i)) / 4;
|
||||||
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
|
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
|
||||||
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
|
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
|
||||||
@@ -245,7 +244,7 @@ public class ScaleGestureDetector {
|
|||||||
mPrevSpanY = mCurrSpanY = spanY;
|
mPrevSpanY = mCurrSpanY = spanY;
|
||||||
mInitialSpan = mPrevSpan = mCurrSpan = span;
|
mInitialSpan = mPrevSpan = mCurrSpan = span;
|
||||||
}
|
}
|
||||||
if (!mInProgress && span > mMinSpan &&
|
if (!mInProgress && span >= mMinSpan &&
|
||||||
(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
|
(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
|
||||||
mPrevSpanX = mCurrSpanX = spanX;
|
mPrevSpanX = mCurrSpanX = spanX;
|
||||||
mPrevSpanY = mCurrSpanY = spanY;
|
mPrevSpanY = mCurrSpanY = spanY;
|
||||||
|
|||||||
@@ -927,8 +927,14 @@
|
|||||||
<integer name="config_multiuserMaximumUsers">1</integer>
|
<integer name="config_multiuserMaximumUsers">1</integer>
|
||||||
|
|
||||||
<!-- Minimum span needed to begin a touch scaling gesture.
|
<!-- 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.
|
This also takes into account the size of any active touch points.
|
||||||
Devices with screens that deviate too far from their assigned density
|
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>
|
<dimen name="config_minScalingSpan">25mm</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user