diff options
Diffstat (limited to 'core/java/android/widget/Gallery.java')
-rw-r--r-- | core/java/android/widget/Gallery.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java index c4ef11c..78ba6e0 100644 --- a/core/java/android/widget/Gallery.java +++ b/core/java/android/widget/Gallery.java @@ -1228,13 +1228,9 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList @Override public boolean onKeyUp(int keyCode, KeyEvent event) { - switch (keyCode) { - case KeyEvent.KEYCODE_DPAD_CENTER: - case KeyEvent.KEYCODE_ENTER: { - + if (KeyEvent.isConfirmKey(keyCode)) { if (mReceivedInvokeKeyDown) { if (mItemCount > 0) { - dispatchPress(mSelectedChild); postDelayed(new Runnable() { @Override @@ -1242,20 +1238,17 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList dispatchUnpress(); } }, ViewConfiguration.getPressedStateDuration()); - + int selectedIndex = mSelectedPosition - mFirstPosition; performItemClick(getChildAt(selectedIndex), mSelectedPosition, mAdapter .getItemId(mSelectedPosition)); } } - + // Clear the flag mReceivedInvokeKeyDown = false; - return true; } - } - return super.onKeyUp(keyCode, event); } |