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

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

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

Set static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1].

Public constructors

PickerColumn

Added in 1.1.0
PickerColumn()

Public functions

getCount

Added in 1.1.0
fun getCount(): Int

Get total items count between minValue and maxValue.

Returns
Int

Total items count between minValue and maxValue.

getCurrentValue

Added in 1.1.0
fun getCurrentValue(): Int

Returns current value of the Column.

Returns
Int

Current value of the Column.

getLabelFor

Added in 1.1.0
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

Added in 1.1.0
fun getLabelFormat(): String!

Return string format (see format) to display label for value.

Returns
String!

String format to display label for value.

getMaxValue

Added in 1.1.0
fun getMaxValue(): Int

Returns maximum value of the Column.

Returns
Int

Maximum value of the Column.

getMinValue

Added in 1.1.0
fun getMinValue(): Int

Returns minimal value of the Column.

Returns
Int

Minimal value of the Column.

getStaticLabels

Added in 1.1.0
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

Added in 1.1.0
fun setCurrentValue(value: Int): Unit

Sets current value of the Column.

setLabelFormat

Added in 1.1.0
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

Added in 1.1.0
fun setMaxValue(maxValue: Int): Unit

Sets maximum value of the Column.

Parameters
maxValue: Int

New maximum value to set.

setMinValue

Added in 1.1.0
fun setMinValue(minValue: Int): Unit

Sets minimal value of the Column.

Parameters
minValue: Int

New minimal value to set.

setStaticLabels

Added in 1.1.0
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.