Skip to content

Most visited

Recently visited

navigation
added in version 24.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

PickerColumn

public class PickerColumn
extends Object

java.lang.Object
   ↳ android.support.v17.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

PickerColumn()

Public methods

int getCount()

Get total items count between minValue and maxValue.

int getCurrentValue()

Returns current value of the Column.

CharSequence getLabelFor(int value)

Get a label for value.

String getLabelFormat()

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

int getMaxValue()

Returns maximum value of the Column.

int getMinValue()

Returns minimal value of the Column.

CharSequence[] getStaticLabels()

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

void setCurrentValue(int value)

Sets current value of the Column.

void setLabelFormat(String labelFormat)

Set string format (see format(String, Object...)) to display label for an integer value.

void setMaxValue(int maxValue)

Sets maximum value of the Column.

void setMinValue(int minValue)

Sets minimal value of the Column.

void setStaticLabels(CharSequence[] labels)

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

Inherited methods

From class java.lang.Object

Public constructors

PickerColumn

added in version 24.1.0
PickerColumn ()

Public methods

getCount

added in version 24.1.0
int getCount ()

Get total items count between minValue and maxValue.

Returns
int Total items count between minValue and maxValue.

getCurrentValue

added in version 24.1.0
int getCurrentValue ()

Returns current value of the Column.

Returns
int Current value of the Column.

getLabelFor

added in version 24.1.0
CharSequence getLabelFor (int value)

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.

Returns
CharSequence Label for the value.

getLabelFormat

added in version 24.1.0
String getLabelFormat ()

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

Returns
String String format to display label for value.

getMaxValue

added in version 24.1.0
int getMaxValue ()

Returns maximum value of the Column.

Returns
int Maximum value of the Column.

getMinValue

added in version 24.1.0
int getMinValue ()

Returns minimal value of the Column.

Returns
int Minimal value of the Column.

getStaticLabels

added in version 24.1.0
CharSequence[] getStaticLabels ()

Returns static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1]. When null, getLabelFormat() will be used.

Returns
CharSequence[]

setCurrentValue

added in version 24.1.0
void setCurrentValue (int value)

Sets current value of the Column.

Parameters
value int

setLabelFormat

added in version 24.1.0
void setLabelFormat (String labelFormat)

Set string format (see format(String, Object...)) 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

added in version 24.1.0
void setMaxValue (int maxValue)

Sets maximum value of the Column.

Parameters
maxValue int: New maximum value to set.

setMinValue

added in version 24.1.0
void setMinValue (int minValue)

Sets minimal value of the Column.

Parameters
minValue int: New minimal value to set.

setStaticLabels

added in version 24.1.0
void setStaticLabels (CharSequence[] labels)

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

Parameters
labels CharSequence: Static labels for each value between minValue and maxValue.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)