Picker

public class Picker
extends FrameLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ androidx.leanback.widget.picker.Picker


Picker is a widget showing multiple customized PickerColumns. The PickerColumns are initialized in setColumns(List). Call setColumnAt(int, PickerColumn) if the column value range or labels change. Call setColumnValue(int, int, boolean) to update the current value of PickerColumn.

Picker has two states and will change height:

  • View.isActivated() is true: Picker shows typically three items vertically (see getActivatedVisibleItemCount()}. Columns other than getSelectedColumn() still shows one item if the Picker is focused. On a touch screen device, the Picker will not get focus so it always show three items on all columns. On a non-touch device (a TV), the Picker will show three items only on currently activated column. If the Picker has focus, it will intercept DPAD directions and select activated column.
  • View.isActivated() is false: Picker shows one item vertically (see getVisibleItemCount()) on all columns. The size of Picker shrinks.

Summary

Nested classes

interface Picker.PickerValueListener

Listener for Picker value changes. 

Inherited constants

Inherited fields

Public constructors

Picker(Context context, AttributeSet attributeSet)

Creates a Picker widget.

Picker(Context context, AttributeSet attrs, int defStyleAttr)

Creates a Picker widget.

Public methods

void addOnValueChangedListener(Picker.PickerValueListener listener)

Register a callback to be invoked when the picker's value has changed.

boolean