public class NumberPicker
extends LinearLayout
Constructor and Description |
---|
NumberPicker(Context ctx)
Constructor for the class.
|
NumberPicker(Context context,
AttributeSet attrs)
Constructor for the class.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Gets the current value of the NumberPicker.
|
void |
setIncrement(int i)
Sets the value that the NumberPicker will increment/decrement when the user presses a button.
|
void |
setPrefix(java.lang.String p)
Sets the string prefix that will appear before the number.
|
void |
setRange(int _min,
int _max)
Sets the range for the NumberPicker.
|
void |
setSuffix(java.lang.String s)
Sets the string suffix that will appear after the number.
|
void |
setValue(int val)
Sets the value of the NumberPicker.
|
public NumberPicker(Context ctx)
ctx
- The context for the NumberPickerpublic NumberPicker(Context context, AttributeSet attrs)
ctx
- The context for the NumberPickerattrs
- The attributes for the NumberPickerpublic int getValue()
public void setValue(int val) throws java.lang.Exception
val
- The new value to setjava.lang.Exception
- Thrown when the number is not within the set bounds of min and maxpublic void setPrefix(java.lang.String p)
p
- The new prefixpublic void setSuffix(java.lang.String s)
s
- The new suffixpublic void setIncrement(int i)
i
- The new increment valuepublic void setRange(int _min, int _max)
_min
- The minimum_max
- The maximum