summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsView.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-10-15 17:59:43 -0700
committerJoe Onorato <joeo@android.com>2009-10-15 17:59:43 -0700
commit68ffd10dfcc7913082183d23949df25c23001e6c (patch)
tree2f6e658881a9428c8a2d9658e58dd0c42fb643f6 /src/com/android/launcher2/AllAppsView.java
parent82ca5500479188743f0e520a5fdfe82e657a8da2 (diff)
downloadandroid_packages_apps_Trebuchet-68ffd10dfcc7913082183d23949df25c23001e6c.tar.gz
android_packages_apps_Trebuchet-68ffd10dfcc7913082183d23949df25c23001e6c.tar.bz2
android_packages_apps_Trebuchet-68ffd10dfcc7913082183d23949df25c23001e6c.zip
Passion - Maybe this will fix bug 2183130 - NPE in AllAppsView.onTouchEvent.
Looking at the code as it was on ERD11, this was mVelocity being null. That shouldn't be possible if events are ordered correctly. This change makes AllAppsView a little more rigorous about which value mTouchTracking has. Hopefully, we can mask any underlying problems sufficiently. Events aren't supposed to be going out of order.
Diffstat (limited to 'src/com/android/launcher2/AllAppsView.java')
-rw-r--r--src/com/android/launcher2/AllAppsView.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index e31fe5d55..b5074b11e 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -69,8 +69,9 @@ public class AllAppsView extends RSSurfaceView
/** Bit for mLocks for when there are icons being loaded. */
private static final int LOCK_ICONS_PENDING = 1;
- private static final int TRACKING_FLING = 0;
- private static final int TRACKING_HOME = 1;
+ private static final int TRACKING_NONE = 0;
+ private static final int TRACKING_FLING = 1;
+ private static final int TRACKING_HOME = 2;
private Launcher mLauncher;
private DragController mDragController;
@@ -258,7 +259,7 @@ public class AllAppsView extends RSSurfaceView
case MotionEvent.ACTION_OUTSIDE:
if (mTouchTracking == TRACKING_HOME) {
// TODO: highlight?
- } else {
+ } else if (mTouchTracking == TRACKING_FLING) {
int rawX = (int)ev.getRawX();
int rawY = (int)ev.getRawY();
int slop;
@@ -306,7 +307,7 @@ public class AllAppsView extends RSSurfaceView
mLauncher.closeAllApps(true);
}
}
- } else {
+ } else if (mTouchTracking == TRACKING_FLING) {
mRollo.mState.newTouchDown = 0;
if (mRotateMove) {
mRollo.mState.newPositionX = ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
@@ -330,8 +331,9 @@ public class AllAppsView extends RSSurfaceView
mVelocity.recycle();
mVelocity = null;
}
- break;
}
+ mTouchTracking = TRACKING_NONE;
+ break;
}
return true;