summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/Gallery.java
diff options
context:
space:
mode:
authorDavid Sobreira Marques <dpsmarques@gmail.com>2012-03-07 18:57:32 -0500
committerDavid Sobreira Marques <dpsmarques@gmail.com>2012-03-07 18:57:32 -0500
commitc742c9fedb1c1d8ecd2914207af51b1ee4f34266 (patch)
tree7da260b78d803868970a5cc69b5dba31701c2f38 /core/java/android/widget/Gallery.java
parentbf1e85bfc8293646d57f0017afbfb0e09a1a41d7 (diff)
downloadframeworks_base-c742c9fedb1c1d8ecd2914207af51b1ee4f34266.zip
frameworks_base-c742c9fedb1c1d8ecd2914207af51b1ee4f34266.tar.gz
frameworks_base-c742c9fedb1c1d8ecd2914207af51b1ee4f34266.tar.bz2
Avoiding horizontal keypad navigation trapping within gallery.
Non touchscreen devices such as Google TV require the keypad navigation to properly move the focus among widgets. The Gallery is misshandling the keypress event and avoiding the focus from going to other widgets on it's sides upon keypress even after the user has reached it's first and last items. Change-Id: If32ee57e8513cac692deb161e1941d6cc85e3188 Signed-off-by: David Sobreira Marques <dpsmarques@gmail.com>
Diffstat (limited to 'core/java/android/widget/Gallery.java')
-rw-r--r--core/java/android/widget/Gallery.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java
index 5e37fa8..ea23a3a 100644
--- a/core/java/android/widget/Gallery.java
+++ b/core/java/android/widget/Gallery.java
@@ -1187,15 +1187,15 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList
case KeyEvent.KEYCODE_DPAD_LEFT:
if (movePrevious()) {
playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
+ return true;
}
- return true;
-
+ break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (moveNext()) {
playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
+ return true;
}
- return true;
-
+ break;
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
mReceivedInvokeKeyDown = true;