summaryrefslogtreecommitdiff
path: root/core/java/android/widget/NumberPicker.java
diff options
context:
space:
mode:
authorJustin Mattson <jmatt@google.com>2012-10-08 11:46:28 -0700
committerJustin Mattson <jmatt@google.com>2012-10-08 11:59:38 -0700
commit86cf0cdfe14ce9606d42671b2961081f3220a789 (patch)
tree14c402ef5eec5d7b5d83a3da453393fc2774ba57 /core/java/android/widget/NumberPicker.java
parent1a7cfd67c2b3f789e6be420958dff60034884491 (diff)
Reverse movement direction of DPAD events
The first way I had it produces somewhat unexpected behavior. If you scroll past the top of the list, focus moves down to the control below. This changes it so scrolling past the bottom of the list moves focus to the next control below. Change-Id: I886e1854df85ceb203dac61c7f8c7daf6749e90e
Diffstat (limited to 'core/java/android/widget/NumberPicker.java')
-rw-r--r--core/java/android/widget/NumberPicker.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 2efcf41019f0..6cfeb15acb12 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -948,13 +948,13 @@ public class NumberPicker extends LinearLayout {
}
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
- if (mWrapSelectorWheel || (keyCode == KeyEvent.KEYCODE_DPAD_UP)
+ if (mWrapSelectorWheel || (keyCode == KeyEvent.KEYCODE_DPAD_DOWN)
? getValue() < getMaxValue() : getValue() > getMinValue()) {
requestFocus();
mLastHandledDownDpadKeyCode = keyCode;
removeAllCallbacks();
if (mFlingScroller.isFinished()) {
- changeValueByOne(keyCode == KeyEvent.KEYCODE_DPAD_UP);
+ changeValueByOne(keyCode == KeyEvent.KEYCODE_DPAD_DOWN);
}
return true;
}