PickerColumn
open class PickerColumn
kotlin.Any | |
↳ | androidx.leanback.widget.picker.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(String)
or a list of static labels set by setStaticLabels(CharSequence[])
.
Summary
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
open Int |
getCount() Get total items count between minValue and maxValue. |
open Int |
Returns current value of the Column. |
open CharSequence! |
getLabelFor(value: Int) Get a label for value. |
open String! |
Return string format (see String#format) to display label for value. |
open Int |
Returns maximum value of the Column. |
open Int |
Returns minimal value of the Column. |
open Array<CharSequence!>! |
Returns static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels. |
open Unit |
setCurrentValue(value: Int) Sets current value of the Column. |
open Unit |
setLabelFormat(labelFormat: String!) Set string format (see String#format) to display label for an integer value. |
open Unit |
setMaxValue(maxValue: Int) Sets maximum value of the Column. |
open Unit |
setMinValue(minValue: Int) Sets minimal value of the Column. |
open Unit |
setStaticLabels(labels: Array<CharSequence!>!) Set static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels. |
Public constructors
<init>
PickerColumn()
Public methods
getCount
open fun getCount(): Int
Get total items count between minValue and maxValue.
Return | |
---|---|
Int |
Total items count between minValue and maxValue. |
getCurrentValue
open fun getCurrentValue(): Int
Returns current value of the Column.
Return | |
---|---|
Int |
Current value of the Column. |
getLabelFor
open fun getLabelFor(value: Int): CharSequence!
Get a label for value. The label can be static setStaticLabels(CharSequence[])
or dynamically generated setLabelFormat(String)
when static labels is null.
Parameters | |
---|---|
value |
Int: Value between minValue and maxValue. |
Return | |
---|---|
CharSequence! |
Label for the value. |
getLabelFormat
open fun getLabelFormat(): String!
Return string format (see String#format) to display label for value.
Return | |
---|---|
String! |
String format to display label for value. |
getMaxValue
open fun getMaxValue(): Int
Returns maximum value of the Column.
Return | |
---|---|
Int |
Maximum value of the Column. |
getMinValue
open fun getMinValue(): Int
Returns minimal value of the Column.
Return | |
---|---|
Int |
Minimal value of the Column. |
getStaticLabels
open 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.
setLabelFormat
open fun setLabelFormat(labelFormat: String!): Unit
Set string format (see String#format) to display label for an integer value. setStaticLabels(CharSequence[])
overrides the format.
Parameters | |
---|---|
labelFormat |
String!: String format to display label for value between minValue and maxValue. |
setMaxValue
open fun setMaxValue(maxValue: Int): Unit
Sets maximum value of the Column.
Parameters | |
---|---|
maxValue |
Int: New maximum value to set. |
setMinValue
open fun setMinValue(minValue: Int): Unit
Sets minimal value of the Column.
Parameters | |
---|---|
minValue |
Int: New minimal value to set. |