am 39511301: Fix crash in crop view

* commit '39511301a29f1965155e848c214dfa4bc3530722':
  Fix crash in crop view
This commit is contained in:
Michael Jurka
2013-10-07 17:19:14 -07:00
committed by Android Git Automerger
+7 -6
View File
@@ -197,13 +197,14 @@ public class CropView extends TiledImageView implements OnScaleGestureListener {
float squaredDist = (mFirstX - x) * (mFirstX - x) + (mFirstY - y) * (mFirstY - y);
float slop = config.getScaledTouchSlop() * config.getScaledTouchSlop();
long now = System.currentTimeMillis();
// only do this if it's a small movement
if (mTouchCallback != null &&
squaredDist < slop &&
now < mTouchDownTime + ViewConfiguration.getTapTimeout()) {
mTouchCallback.onTap();
if (mTouchCallback != null) {
// only do this if it's a small movement
if (squaredDist < slop &&
now < mTouchDownTime + ViewConfiguration.getTapTimeout()) {
mTouchCallback.onTap();
}
mTouchCallback.onTouchUp();
}
mTouchCallback.onTouchUp();
}
if (!mTouchEnabled) {