NumberPicker

open class NumberPicker

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; I have made a few slight modifications to the code here, I simply put a MAX and MIN default in the code but these values can still be set publicly by calling code.

Author

Google

Constructors

Link copied to clipboard
constructor(context: Context)
constructor(context: Context, attrs: AttributeSet)
constructor(context: Context, attrs: AttributeSet, defStyle: Int)

Types

Link copied to clipboard
interface Formatter
Link copied to clipboard
private open class NumberPickerInputFilter
Link copied to clipboard
private open class NumberRangeKeyListener
Link copied to clipboard

Properties

Link copied to clipboard
private val DEFAULT_MAX: Int = 200
Link copied to clipboard
private val DEFAULT_MIN: Int = 0
Link copied to clipboard
private val DEFAULT_VALUE: Int = 0
Link copied to clipboard
private val DEFAULT_WRAP: Boolean = true
Link copied to clipboard
Link copied to clipboard
protected open var mCurrent: Int
Link copied to clipboard
private open var mDecrement: Boolean
Link copied to clipboard
Link copied to clipboard
private open var mDisplayedValues: Array<String>
Link copied to clipboard
protected open var mEnd: Int
Link copied to clipboard
Link copied to clipboard
private val mHandler: Handler
Link copied to clipboard
private open var mIncrement: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val mNumberInputFilter: InputFilter
Link copied to clipboard
protected open var mPrevious: Int
Link copied to clipboard
private val mRunnable: Runnable
Link copied to clipboard
protected open var mSpeed: Long
Link copied to clipboard
protected open var mStart: Int
Link copied to clipboard
private val mText: EditText
Link copied to clipboard
protected open var mWrap: Boolean
Link copied to clipboard
private val TAG: String = "NumberPicker"
Link copied to clipboard

Functions

Link copied to clipboard
open fun cancelDecrement()
Link copied to clipboard
open fun cancelIncrement()
Link copied to clipboard
protected open fun changeCurrent(current: Int)
Link copied to clipboard
protected open fun formatNumber(value: Int): String
Link copied to clipboard
open fun getCurrent(): Int
Link copied to clipboard
open fun getEnd(): Int
Link copied to clipboard
private open fun getSelectedPos(str: String): Int
Link copied to clipboard
open fun getStart(): Int
Link copied to clipboard
protected open fun notifyChange()
Link copied to clipboard
open fun onClick(v: View)
Link copied to clipboard
open fun onEditorAction(v: TextView, actionId: Int, event: KeyEvent): Boolean
Link copied to clipboard
open fun onFocusChange(v: View, hasFocus: Boolean)
Link copied to clipboard
open fun onLongClick(v: View): Boolean
We start the long click here but rely on the NumberPickerButton to inform us when the long click has ended.
Link copied to clipboard
open fun setCurrent(current: Int)
Link copied to clipboard
open fun setCurrentAndNotify(current: Int)
Link copied to clipboard
open fun setEnabled(enabled: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setRange(start: Int, end: Int)
open fun setRange(start: Int, end: Int, displayedValues: Array<String>)
Set the range of numbers allowed for the number picker.
Link copied to clipboard
open fun setSpeed(speed: Long)
The speed (in milliseconds) at which the numbers will scroll when the the +/- buttons are longpressed.
Link copied to clipboard
open fun setWrap(wrap: Boolean)
Specify if numbers should wrap after the edge has been reached.
Link copied to clipboard
protected open fun updateView()
Link copied to clipboard
private open fun validateCurrentView(str: CharSequence)
Link copied to clipboard
private open fun validateInput(v: View)