PickerColumn
class PickerColumn
Picker column class used by Picker, defines a contiguous value ranges and associated labels. A PickerColumn has a minValue and maxValue to choose between. The Picker column has a current value. The labels can be dynamically generated from value by setLabelFormat or a list of static labels set by setStaticLabels.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
Int |
getCount()Get total items count between minValue and maxValue. |
Int |
Returns current value of the Column. |
CharSequence! |
getLabelFor(value: Int)Get a label for value. |
String! |
Return string format (see format) to display label for value. |
Int |
Returns maximum value of the Column. |
Int |
Returns minimal value of the Column. |
Array<CharSequence!>! |
Returns static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1]. |
Unit |
setCurrentValue(value: Int)Sets current value of the Column. |
Unit |
setLabelFormat(labelFormat: String!)Set string format (see format) to display label for an integer value. |
Unit |
setMaxValue(maxValue: Int)Sets maximum value of the Column. |
Unit |
setMinValue(minValue: Int)Sets minimal value of the Column. |
Unit |
setStaticLabels(labels: Array<CharSequence!>!)Set static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1]. |
Public constructors
Public functions
getCount
fun getCount(): Int
Get total items count between minValue and maxValue.
| Returns | |
|---|---|
Int |
Total items count between minValue and maxValue. |
getCurrentValue
fun getCurrentValue(): Int
Returns current value of the Column.
| Returns | |
|---|---|
Int |
Current value of the Column. |
getLabelFor
fun getLabelFor(value: Int): CharSequence!
Get a label for value. The label can be static setStaticLabels or dynamically generated setLabelFormat when static labels is null.
| Parameters | |
|---|---|
value: Int |
Value between minValue and maxValue. |
| Returns | |
|---|---|
CharSequence! |
Label for the value. |
getLabelFormat
fun getLabelFormat(): String!
Return string format (see format) to display label for value.
| Returns | |
|---|---|
String! |
String format to display label for value. |
getMaxValue
fun getMaxValue(): Int
Returns maximum value of the Column.
| Returns | |
|---|---|
Int |
Maximum value of the Column. |
getMinValue
fun getMinValue(): Int
Returns minimal value of the Column.
| Returns | |
|---|---|
Int |
Minimal value of the Column. |
getStaticLabels
fun getStaticLabels(): Array<CharSequence!>!
Returns static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1]. When null, getLabelFormat will be used.
setCurrentValue
fun setCurrentValue(value: Int): Unit
Sets current value of the Column.
setLabelFormat
fun setLabelFormat(labelFormat: String!): Unit
Set string format (see format) to display label for an integer value. setStaticLabels overrides the format.
| Parameters | |
|---|---|
labelFormat: String! |
String format to display label for value between minValue and maxValue. |
setMaxValue
fun setMaxValue(maxValue: Int): Unit
Sets maximum value of the Column.
| Parameters | |
|---|---|
maxValue: Int |
New maximum value to set. |
setMinValue
fun setMinValue(minValue: Int): Unit
Sets minimal value of the Column.
| Parameters | |
|---|---|
minValue: Int |
New minimal value to set. |
setStaticLabels
fun setStaticLabels(labels: Array<CharSequence!>!): Unit
Set static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1].
| Parameters | |
|---|---|
labels: Array<CharSequence!>! |
Static labels for each value between minValue and maxValue. |