am 859b3a74: fix bug 2200625 - NPE at com.android.launcher2.AllAppsView.onTouchEvent(AllAppsView.java:259) on Passion

Merge commit '859b3a7453c7b631a34acde4df9bdca680967520' into eclair-mr2

* commit '859b3a7453c7b631a34acde4df9bdca680967520':
  fix bug 2200625 - NPE at com.android.launcher2.AllAppsView.onTouchEvent(AllAppsView.java:259) on Passion
This commit is contained in:
Joe Onorato
2009-10-29 13:41:56 -07:00
committed by Android Git Automerger
@@ -192,6 +192,11 @@ public class AllAppsView extends RSSurfaceView
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
if (!isVisible()) {
return;
}
if (gainFocus) {
if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
// Select the first icon when we gain keyboard focus
@@ -212,6 +217,10 @@ public class AllAppsView extends RSSurfaceView
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (!isVisible()) {
return false;
}
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) {
if (mArrowNavigation) {
int whichApp = mRollo.mState.selectedIconIndex;