Fix crash in crop view
Bug: 11120454
diff --git a/src/com/android/launcher3/CropView.java b/src/com/android/launcher3/CropView.java
index f68f739..c8b974d 100644
--- a/src/com/android/launcher3/CropView.java
+++ b/src/com/android/launcher3/CropView.java
@@ -197,13 +197,14 @@
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) {