com.blogspot.applications4android.comicreader.numpicker
Class NumberPicker
java.lang.Object
LinearLayout
com.blogspot.applications4android.comicreader.numpicker.NumberPicker
public class NumberPicker
- extends LinearLayout
This class has been pulled from the Android platform source code, its an internal widget that hasn't been
made public so its included in the project in this fashion for use with the preferences screen.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FIVE_DIGIT_FORMATTER
public static final NumberPicker.Formatter FIVE_DIGIT_FORMATTER
mStart
protected int mStart
mEnd
protected int mEnd
mCurrent
protected int mCurrent
mPrevious
protected int mPrevious
NumberPicker
public NumberPicker(Context context)
NumberPicker
public NumberPicker(Context context,
AttributeSet attrs)
NumberPicker
public NumberPicker(Context context,
AttributeSet attrs,
int defStyle)
onCancelListener
public void onCancelListener(View.OnClickListener l)
onSetListener
public void onSetListener(View.OnClickListener l)
setEnabled
public void setEnabled(boolean enabled)
setOnChangeListener
public void setOnChangeListener(NumberPicker.OnChangedListener listener)
setFormatter
public void setFormatter(NumberPicker.Formatter formatter)
setRange
public void setRange(int start,
int end)
- Set the range of numbers allowed for the number picker. The current
value will be automatically set to the start.
- Parameters:
start
- the start of the range (inclusive)end
- the end of the range (inclusive)
setRange
public void setRange(int start,
int end,
java.lang.String[] displayedValues)
- Set the range of numbers allowed for the number picker. The current
value will be automatically set to the start. Also provide a mapping
for values used to display to the user.
- Parameters:
start
- the start of the range (inclusive)end
- the end of the range (inclusive)displayedValues
- the values displayed to the user.
setCurrent
public void setCurrent(int current)
setSpeed
public void setSpeed(long speed)
- The speed (in milliseconds) at which the numbers will scroll
when the the +/- buttons are longpressed. Default is 50ms.
onClick
public void onClick(View v)
changeCurrent
protected void changeCurrent(int current)
notifyChange
protected void notifyChange()
updateView
protected void updateView()
onFocusChange
public void onFocusChange(View v,
boolean hasFocus)
onLongClick
public boolean onLongClick(View v)
- We start the long click here but rely on the
NumberPickerButton
to inform us when the long click has ended.
cancelIncrement
public void cancelIncrement()
cancelDecrement
public void cancelDecrement()
getCurrent
public int getCurrent()
- Returns:
- the current value.