Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b64976f authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android Git Automerger
Browse files

am 0ee79040: am 15861683: am e9812bae: Merge "Revert "NumberPicker should...

am 0ee79040: am 15861683: am e9812bae: Merge "Revert "NumberPicker should adjust min and max when displayed values are set." (a.k.a. Santa is back)" into jb-mr1-dev

* commit '0ee79040':
  Revert "NumberPicker should adjust min and max when displayed values are set." (a.k.a. Santa is back)
parents 4e79b3fd 0ee79040
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -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);
        }