summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2012-11-27 08:21:10 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2012-11-27 08:21:11 -0800
commit5132d62600484bb4fce86295b288c782bee91de8 (patch)
tree058e4eefe1dcd1aaf58e4f57efc8f792e101535a /core/java/android/widget
parent6e8c1495f6a65124750155409ce326736744a42b (diff)
parentabb4a7008a1f5eab6cfaf7e9dd4779e549c21714 (diff)
downloadframeworks_base-5132d62600484bb4fce86295b288c782bee91de8.zip
frameworks_base-5132d62600484bb4fce86295b288c782bee91de8.tar.gz
frameworks_base-5132d62600484bb4fce86295b288c782bee91de8.tar.bz2
Merge jb-mr1-dev into aosp/master - do not merge
Change-Id: Iee4af268c5c2930c59ee237e796467d79cedbbfc
Diffstat (limited to 'core/java/android/widget')
-rw-r--r--core/java/android/widget/NumberPicker.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 6cfeb15..74ded18 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -1314,7 +1314,12 @@ public class NumberPicker extends LinearLayout {
/**
* Sets the min value of the picker.
*
- * @param minValue The min value.
+ * @param minValue The min value inclusive.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * set via {@link #setDisplayedValues(String[])} must be equal to the
+ * range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setMinValue(int minValue) {
if (mMinValue == minValue) {
@@ -1347,7 +1352,12 @@ public class NumberPicker extends LinearLayout {
/**
* Sets the max value of the picker.
*
- * @param maxValue The max value.
+ * @param maxValue The max value inclusive.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * set via {@link #setDisplayedValues(String[])} must be equal to the
+ * range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setMaxValue(int maxValue) {
if (mMaxValue == maxValue) {
@@ -1381,6 +1391,10 @@ public class NumberPicker extends LinearLayout {
* Sets the values to be displayed.
*
* @param displayedValues The displayed values.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * must be equal to the range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setDisplayedValues(String[] displayedValues) {
if (mDisplayedValues == displayedValues) {
@@ -1391,14 +1405,6 @@ public class NumberPicker extends LinearLayout {
// Allow text entry rather than strictly numeric entry.
mInputText.setRawInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
- // Make sure the min, max, respect the size of the displayed
- // values. This will take care of the current value as well.
- if (getMinValue() >= displayedValues.length) {
- setMinValue(0);
- }
- if (getMaxValue() >= displayedValues.length) {
- setMaxValue(displayedValues.length - 1);
- }
} else {
mInputText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
}