public class

ListPickerFormCell

extends LinearLayout
implements FormCell<T> InlineValidation SupportsKey
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.sap.cloud.mobile.fiori.formcell.ListPickerFormCell<V extends android.view.View>

Class Overview

A Fiori control to present a large list of items to choose from. List is presented in a separate activity.

Structure of the control is:

  • Key : Label view acts as key/tag or name for the view. See also : setKey(CharSequence)
  • ListFormCellFilterActivity : This is the activity used to present the complete list of items into a RecyclerView. ListPickerFormCell opens the given ListFormCellFilterActivity specified with setListFormCellFilterActivity(ListFormCellFilterActivity).
  • Display Value: Show the selected items as more informative message. See also: setDisplayValue(CharSequence) (CharSequence)}
  • use GenericListPickerFormCell instead

    Summary

    XML Attributes
    Attribute Name Related Method Description
    FormCellMetadataLayout_android_clickable setClickable(boolean)  
    FormCellMetadataLayout_android_enabled setEnabled(boolean)  
    FormCellMetadataLayout_android_focusable setFocusable(boolean)  
    FormCellMetadataLayout_errorEnabled setErrorEnabled(boolean)  
    FormCellMetadataLayout_helperEnabled setHelperEnabled(boolean)  
    FormCellMetadataLayout_helperText setHelperText(CharSequence)  
    FormCellMetadataLayout_helperTextTextAppearance setHelperTextAppearance(int)  
    FormCellMetadataLayout_label setLabel(CharSequence)  
    FormCellMetadataLayout_labelEnabled setLabelEnabled(boolean)  
    FormCellMetadataLayout_labelTextAppearance setLabelTextAppearanceFocused(int)  
    FormCellMetadataLayout_labelTextAppearanceFocused setLabelTextAppearanceFocused(int)  
    FormCellMetadataLayout_labelTextAppearanceUnFocused setLabelTextAppearanceFocused(int)  
    [Expand]
    Inherited Constants
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    Fields
    protected CharSequence mErrorMessage
    protected int mErrorTextAppearance
    protected CharSequence mHelperText
    protected int mHelperTextAppearance
    protected int mHorizontalMargin
    protected boolean mIsInError
    protected boolean mIsTablet
    protected int mLabelTextAppearance
    protected int mLabelTextAppearanceUnFocused
    protected TextView mLabelTextView
    protected boolean mShouldAttachOrientationListener
    protected TextView mStatusView
    [Expand]
    Inherited Fields
    From class android.view.View
    Public Constructors
    ListPickerFormCell(Context context)
    Construct a new ListPickerFormCell with default styling, sets the CellType to WidgetType.LISTPICKER
    ListPickerFormCell(Context context, AttributeSet attrs)
    Construct a new ListPickerFormCell with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.LISTPICKER
    Public Methods
    void addView(View child, int index, ViewGroup.LayoutParams params)
    Add given view in the view
    void bindViewById(boolean bindViewId)
    Set if use the position instead of positions to layout the elements
    String getActivityTitle()
    Returns the title on the toolbar for the ListFormCellFilterActivity which will display the item list
    int getCellType()
    Return the enum value for ListPickerFormCell
    CellValueChangeListener<List<Integer>> getCellValueChangeListener()
    Return the value change handler of the control
    CharSequence getDisplayValue()
    CharSequence getError()
    Get error set on the view
    TextView getErrorView()
    CharSequence getKey()
    Get the key of the cell
    TextView getKeyLabel()
    Return the view holding the keyname string
    ListFormCellFilterActivity getListFormCellFilterActivity()
    Returns the activity for displaying the list of available options
    List<Integer> getValue()
    Returns the list of index of selected items
    TextView getValueTextFieldView()
    Return the view holding the value string
    boolean isEditable()
    Get is the cell is editable.
    boolean isErrorEnabled()
    Is error enabled on the view
    boolean isHelperEnabled()
    Set if the helper field is enabled on the view
    boolean isLabelEnabled()
    Is the label field on the view is enabled
    boolean isSingleSelectOn()
    Is multiple selection enabled?
    boolean onInterceptTouchEvent(MotionEvent ev)
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    void setActivityTitle(String activityTitle)
    Sets the toolbar title in the ListFormCellFilterActivity
    void setAllItemLabel(CharSequence allItemLabel)
    Set the label for "All" item section.
    void setCellValueChangeListener(CellValueChangeListener<List<Integer>> listener)
    void setClickable(boolean clickable)
    Enable or disable clickable property on the view and all its children
    void setDisplayValue(CharSequence valueTextField)
    Sets the display value for the selected items
    void setDisplayValueTextAppearance(int res)
    void setEditable(boolean isEditable)
    Enable or disable the Cell
    void setEnabled(boolean enabled)
    Enable or disable the view
    void setError(CharSequence error)
    Set the error on view
    void setErrorEnabled(boolean errorEnabled)
    Enable or disable error enabled
    void setErrorTextAppearance(int resId)
    Set the error text appearance
    void setFocusable(boolean focusable)
    Enable or disable focusable property on the view and all its children
    void setKey(CharSequence keyName)
    Set the key of the cell
    void setKeyTextAppearance(int resId)
    Set the appearance of the key
    void setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
    Set the label text appearance when the view is not focused
    void setListFormCellFilterActivity(ListFormCellFilterActivity<V, ?> listFormCellFilterActivity)
    Sets the activity where the intent will be passed and the list of available options will be displayed
    void setOverrideKeyStyle(boolean overrideKeyStyle)
    Override the Key styling manually.
    void setOverrideStatusStyle(boolean overrideStatusStyle)
    Override the status i.e.
    void setSelectButtonColorTint(ColorStateList color)
    Set the tint on icon drawable of the cell
    void setSelectIconDrawable(int res)
    Change the select icon drawable of the cell
    void setSelectIconDrawable(Drawable res)
    Change the select icon drawable of the cell
    void setSelectedItemLabel(CharSequence selectedItemLabel)
    Set the label for "Selected" item section.
    void setSelectorOnStart(boolean isOnStart)
    Show the check/radio buttons on the start or the end of the layout
    void setShouldAttachOrientationListener(boolean shouldAttach)
    Determines if an OrientationEventListener should be attached.
    void setShowSelected(boolean showSelected)
    Show or hide the selected item section on the list picker formcell
    void setSingleSelectOn(boolean singleSelectOn)
    Enable or disable single/multiple selection
    void setValue(List<Integer> value)
    Set the value on the cell i.e.
    Protected Methods
    void adjustMargins()
    Calculate and set the margins for the cell's elements.
    static boolean arrayContains(int[] array, int value)
    Check if the array contains the given property
    void drawableStateChanged()
    Drawable state changed
    TextView generateTextView()
    Generate the text view
    ViewGroup.LayoutParams getDefaultLayoutParams()
    CharSequence getHelperText()
    Get the helper text from the view
    CharSequence getLabel()
    Get the label on the view
    void notifyCellValueChanged(List<Integer> selections)
    void onSizeChanged(int w, int h, int oldw, int oldh)
    void replaceStatusView()
    Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout
    void setHelperEnabled(boolean helperEnabled)
    Enable or disable the helper field on the view
    void setHelperText(CharSequence helper)
    Set the helper text on the view
    void setHelperTextAppearance(int helperTextAppearance)
    Set the helper text appearance
    void setLabel(CharSequence key)
    Set the label on the view
    void setLabelEnabled(boolean keyEnabled)
    Enable or disable the label field on the view
    void setLabelTextAppearance(int textAppearance)
    Set the text appearance on the label.
    void setLabelTextAppearanceFocused(int textAppearance)
    Set the text appearance on the label when the view is not focused
    void setLabelTextColorError(ColorStateList color)
    Set the text color of the label for error mode
    void setLabelTextColorFocused(ColorStateList color)
    Set the color of label when the view is focused
    void setLabelTextColorUnFocused(ColorStateList color)
    Set the color of label when the view is not focused
    boolean setupErrorHelperView()
    Setup the error/helper field on the view
    boolean setupLabelView()
    Setup the label view on the view
    boolean shouldLayout(View v)
    Should layout the given view
    [Expand]
    Inherited Methods
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    From class java.lang.Object
    From interface android.graphics.drawable.Drawable.Callback
    From interface android.view.KeyEvent.Callback
    From interface android.view.ViewManager
    From interface android.view.ViewParent
    From interface android.view.accessibility.AccessibilityEventSource
    From interface com.sap.cloud.mobile.fiori.formcell.FormCell
    From interface com.sap.cloud.mobile.fiori.formcell.InlineValidation
    From interface com.sap.cloud.mobile.fiori.formcell.SupportsKey

    XML Attributes

    FormCellMetadataLayout_android_clickable

    Related Methods

    FormCellMetadataLayout_android_enabled

    Related Methods

    FormCellMetadataLayout_android_focusable

    Related Methods

    FormCellMetadataLayout_errorEnabled

    Related Methods

    FormCellMetadataLayout_helperEnabled

    Related Methods

    FormCellMetadataLayout_helperText

    Related Methods

    FormCellMetadataLayout_helperTextTextAppearance

    FormCellMetadataLayout_label

    Related Methods

    FormCellMetadataLayout_labelEnabled

    Related Methods

    FormCellMetadataLayout_labelTextAppearance

    FormCellMetadataLayout_labelTextAppearanceFocused

    FormCellMetadataLayout_labelTextAppearanceUnFocused

    Fields

    protected CharSequence mErrorMessage

    protected int mErrorTextAppearance

    protected CharSequence mHelperText

    protected int mHelperTextAppearance

    protected int mHorizontalMargin

    protected boolean mIsInError

    protected boolean mIsTablet

    protected int mLabelTextAppearance

    protected int mLabelTextAppearanceUnFocused

    protected TextView mLabelTextView

    protected boolean mShouldAttachOrientationListener

    protected TextView mStatusView

    Public Constructors

    public ListPickerFormCell (Context context)

    Construct a new ListPickerFormCell with default styling, sets the CellType to WidgetType.LISTPICKER

    Parameters
    context context

    public ListPickerFormCell (Context context, AttributeSet attrs)

    Construct a new ListPickerFormCell with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.LISTPICKER

    Parameters
    context context
    attrs attribute set

    Public Methods

    public void addView (View child, int index, ViewGroup.LayoutParams params)

    Add given view in the view

    Parameters
    child View
    index position at which the view has to be added
    params ViewGroup.LayoutParams

    public void bindViewById (boolean bindViewId)

    Set if use the position instead of positions to layout the elements

    Parameters
    bindViewId boolean

    public String getActivityTitle ()

    Returns the title on the toolbar for the ListFormCellFilterActivity which will display the item list

    Returns
    • String title for the activity on the toolbar

    public int getCellType ()

    Return the enum value for ListPickerFormCell

    Returns
    • WidgetType type of the control which has implemented FormCell

    public CellValueChangeListener<List<Integer>> getCellValueChangeListener ()

    Return the value change handler of the control

    Returns
    • OnCellChangeListener - value change listener of the control

    public CharSequence getDisplayValue ()

    public CharSequence getError ()

    Get error set on the view

    Returns
    • error as CharSequence

    public TextView getErrorView ()

    public CharSequence getKey ()

    Get the key of the cell

    Returns
    • CharSequence

    public TextView getKeyLabel ()

    Return the view holding the keyname string

    Returns
    • TextView textview displaying keyname

    public ListFormCellFilterActivity getListFormCellFilterActivity ()

    Returns the activity for displaying the list of available options

    Returns
    • ListFormCellFilterActivity activity for displaying available options

    public List<Integer> getValue ()

    Returns the list of index of selected items

    Returns
    • List selected items index list

    public TextView getValueTextFieldView ()

    Return the view holding the value string

    Returns
    • TextView textview displaying value

    public boolean isEditable ()

    Get is the cell is editable.

    Returns
    • boolean

    public boolean isErrorEnabled ()

    Is error enabled on the view

    Related XML Attributes
    Returns
    • boolean

    public boolean isHelperEnabled ()

    Set if the helper field is enabled on the view

    Related XML Attributes
    Returns
    • boolean

    public boolean isLabelEnabled ()

    Is the label field on the view is enabled

    Related XML Attributes
    Returns
    • boolean

    public boolean isSingleSelectOn ()

    Is multiple selection enabled?

    Returns
    • boolean

    public boolean onInterceptTouchEvent (MotionEvent ev)

    public void onRestoreInstanceState (Parcelable state)

    public Parcelable onSaveInstanceState ()

    public void setActivityTitle (String activityTitle)

    Sets the toolbar title in the ListFormCellFilterActivity

    Parameters
    activityTitle title of the activity displaying the item list

    public void setAllItemLabel (CharSequence allItemLabel)

    Set the label for "All" item section.

    Parameters
    allItemLabel CharSequence

    public void setCellValueChangeListener (CellValueChangeListener<List<Integer>> listener)

    public void setClickable (boolean clickable)

    Enable or disable clickable property on the view and all its children

    Parameters
    clickable boolean

    public void setDisplayValue (CharSequence valueTextField)

    Sets the display value for the selected items

    Parameters
    valueTextField display value for the selected items

    public void setDisplayValueTextAppearance (int res)

    public void setEditable (boolean isEditable)

    Enable or disable the Cell

    Parameters
    isEditable boolean

    public void setEnabled (boolean enabled)

    Enable or disable the view

    Parameters
    enabled boolean

    public void setError (CharSequence error)

    Set the error on view

    Parameters
    error CharSequence

    public void setErrorEnabled (boolean errorEnabled)

    Enable or disable error enabled

    Related XML Attributes
    Parameters
    errorEnabled boolean

    public void setErrorTextAppearance (int resId)

    Set the error text appearance

    Parameters
    resId Style Res

    public void setFocusable (boolean focusable)

    Enable or disable focusable property on the view and all its children

    Parameters
    focusable boolean

    public void setKey (CharSequence keyName)

    Set the key of the cell

    Parameters
    keyName key
    See Also

    public void setKeyTextAppearance (int resId)

    Set the appearance of the key

    Parameters
    resId style resource

    public void setLabelTextAppearanceUnFocused (int labelTextAppearanceUnFocused)

    Set the label text appearance when the view is not focused

    Parameters
    labelTextAppearanceUnFocused Style resource

    public void setListFormCellFilterActivity (ListFormCellFilterActivity<V, ?> listFormCellFilterActivity)

    Sets the activity where the intent will be passed and the list of available options will be displayed

    Parameters
    listFormCellFilterActivity activity for the item list to be displayed

    public void setOverrideKeyStyle (boolean overrideKeyStyle)

    Override the Key styling manually.

    Parameters
    overrideKeyStyle boolean

    public void setOverrideStatusStyle (boolean overrideStatusStyle)

    Override the status i.e. error and helper styling manually

    Parameters
    overrideStatusStyle boolean

    public void setSelectButtonColorTint (ColorStateList color)

    Set the tint on icon drawable of the cell

    Parameters
    color ColorStateList tint color state list

    public void setSelectIconDrawable (int res)

    Change the select icon drawable of the cell

    Parameters
    res Drawable resource

    public void setSelectIconDrawable (Drawable res)

    Change the select icon drawable of the cell

    Parameters
    res Drawable

    public void setSelectedItemLabel (CharSequence selectedItemLabel)

    Set the label for "Selected" item section.

    Parameters
    selectedItemLabel CharSequence

    public void setSelectorOnStart (boolean isOnStart)

    Show the check/radio buttons on the start or the end of the layout

    Parameters
    isOnStart boolean

    public void setShouldAttachOrientationListener (boolean shouldAttach)

    Determines if an OrientationEventListener should be attached.

    Parameters
    shouldAttach Whether the FormCell should consider attaching an OrientationEventListener or not

    public void setShowSelected (boolean showSelected)

    Show or hide the selected item section on the list picker formcell

    Parameters
    showSelected boolean

    public void setSingleSelectOn (boolean singleSelectOn)

    Enable or disable single/multiple selection

    Parameters
    singleSelectOn boolean

    public void setValue (List<Integer> value)

    Set the value on the cell i.e. selected items

    Parameters
    value value of the property
    See Also

    Protected Methods

    protected void adjustMargins ()

    Calculate and set the margins for the cell's elements. Subclasses should override this method to suit their own needs.

    protected static boolean arrayContains (int[] array, int value)

    Check if the array contains the given property

    Parameters
    array array of integer
    value int
    Returns
    • boolean

    protected void drawableStateChanged ()

    Drawable state changed

    protected TextView generateTextView ()

    Generate the text view

    Returns
    • TextView

    protected ViewGroup.LayoutParams getDefaultLayoutParams ()

    protected CharSequence getHelperText ()

    Get the helper text from the view

    Related XML Attributes
    Returns
    • CharSequence

    protected CharSequence getLabel ()

    Get the label on the view

    Related XML Attributes
    Returns
    • CharSequence

    protected void notifyCellValueChanged (List<Integer> selections)

    protected void onSizeChanged (int w, int h, int oldw, int oldh)

    protected void replaceStatusView ()

    Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout

    protected void setHelperEnabled (boolean helperEnabled)

    Enable or disable the helper field on the view

    Related XML Attributes
    Parameters
    helperEnabled boolean
    See Also

    protected void setHelperText (CharSequence helper)

    Set the helper text on the view

    Related XML Attributes
    Parameters
    helper CharSequence
    See Also

    protected void setHelperTextAppearance (int helperTextAppearance)

    Set the helper text appearance

    Parameters
    helperTextAppearance style resource

    protected void setLabel (CharSequence key)

    Set the label on the view

    Related XML Attributes
    Parameters
    key CharSequence
    See Also

    protected void setLabelEnabled (boolean keyEnabled)

    Enable or disable the label field on the view

    Related XML Attributes
    Parameters
    keyEnabled boolean
    See Also

    protected void setLabelTextAppearance (int textAppearance)

    Set the text appearance on the label. This changes the appearance when the view is focused and unfocused

    Parameters
    textAppearance style resource

    protected void setLabelTextAppearanceFocused (int textAppearance)

    Set the text appearance on the label when the view is not focused

    Parameters
    textAppearance Style resource

    protected void setLabelTextColorError (ColorStateList color)

    Set the text color of the label for error mode

    Parameters
    color ColorStateList

    protected void setLabelTextColorFocused (ColorStateList color)

    Set the color of label when the view is focused

    Parameters
    color ColorStateList

    protected void setLabelTextColorUnFocused (ColorStateList color)

    Set the color of label when the view is not focused

    Parameters
    color ColorStateList

    protected boolean setupErrorHelperView ()

    Setup the error/helper field on the view

    Returns
    • boolean true: new view is created false:existing view is used

    protected boolean setupLabelView ()

    Setup the label view on the view

    Returns
    • boolean true: new view is created false:existing view is used

    protected boolean shouldLayout (View v)

    Should layout the given view

    Parameters
    v View
    Returns
    • boolean