public class

GenericListPickerFormCell

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

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)
  • GenericListPickerFormCellActivity : This is the activity used to present the complete list of items into a RecyclerView. GenericListPickerFormCell opens the given GenericListPickerFormCellActivity specified with setPickerActivity(GenericListPickerFormCellActivity).
  • Display Value: Show the selected items as more informative message. See also: setDisplayValue(CharSequence) (CharSequence)}
  • Summary

    XML Attributes
    Attribute Name Related Method Description
    FormCellMetadataLayout_android_enabled setEnabled(boolean)  
    FormCellMetadataLayout_errorEnabled setErrorEnabled(boolean)  
    [Expand]
    Inherited XML Attributes
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    Constants
    String ALL_ITEM_LABEL
    String CLEAR_SINGLE_SELECTION
    String DISMISS_ON_SINGLE_SELECTION
    String PICKER_LAYOUT
    String RECYCLER_ID
    String SELECTED_ITEM_LABEL
    String SELECTED_POS_OR_IDS
    String SELECTOR_ON_START
    String SHOW_SELECTED
    String SINGLE_SELECT_ON
    String USER_DATA
    [Expand]
    Inherited Constants
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    [Expand]
    Inherited Fields
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    From class android.view.View
    Public Constructors
    GenericListPickerFormCell(Context context)
    Construct a new GenericListPickerFormCell with default styling, sets the CellType to WidgetType.GENERIC_LISTPICKER
    GenericListPickerFormCell(Context context, AttributeSet attrs)
    Construct a new GenericListPickerFormCell with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.GENERIC_LISTPICKER
    Public Methods
    String getActivityTitle()
    Returns the title on the toolbar for the GenericListPickerFormCellActivity which will display the item list
    int getCellType()
    Return the enum value for GenericListPickerFormCell
    CellValueChangeListener<List<T>> 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
    List<T> 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 isSingleSelectOnly()
    Is multiple selection enabled?
    boolean onInterceptTouchEvent(MotionEvent ev)
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    void setActivityTitle(String activityTitle)
    Sets the toolbar title in the GenericListPickerFormCellActivity
    void setAllItemLabel(CharSequence allItemLabel)
    Set the label for "All" item section.
    void setCellValueChangeListener(CellValueChangeListener<List<T>> listener)
    Set the CellValueChangeListener to listen to updates to the picker
    void setClearSingleSelection(boolean enable)
    Allow enable of items when already selected item is clicked.
    void setDismissOnSingleSelection(boolean dismissOnSingleSelection)
    Automatically dismisses the picker when user selects an item.
    void setDisplayValue(CharSequence valueTextField)
    Sets the display value for the selected items
    void setDisplayValueHint(CharSequence hint)
    Set the hint on the display value
    void setDisplayValueHint(int hint)
    Set the hint on the display value
    void setDisplayValueTextAppearance(int res)
    Set the display value text appearance
    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 setKey(CharSequence keyName)
    Set the key of the cell
    void setKeyTextAppearance(int resId)
    Set the appearance of the key
    void setLayoutRes(int layoutRes, int recyclerViewId)
    Set the layout resource and recycler view id to be used to inflate the picker
    void setLeftToRight(boolean leftToRight)
    Show the check/radio buttons on the start or the end of the layout
    void setPickerActivity(GenericListPickerFormCellActivity<V, T> listPickerActivity)
    Sets the activity where the intent will be passed and the list of available options will be displayed
    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 setSingleSelectOnly(boolean enableSingleSelect)
    Enable or disable single/multiple selection
    void setValue(List<T> value)
    Set the value on the cell i.e.
    void showSelected(boolean showSelected)
    Show or hide the selected item section on the list picker formcell
    Protected Methods
    void adjustMargins()
    Calculate and set the margins for the cell's elements.
    void onSizeChanged(int w, int h, int oldw, int oldh)
    [Expand]
    Inherited Methods
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    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_enabled

    Related Methods

    FormCellMetadataLayout_errorEnabled

    Related Methods

    Constants

    public static final String ALL_ITEM_LABEL

    Constant Value: "LABEL_FOR_ALL_ITEM"

    public static final String CLEAR_SINGLE_SELECTION

    Constant Value: "CLEAR_SINGLE_SELECTION"

    public static final String DISMISS_ON_SINGLE_SELECTION

    Constant Value: "DISMISS_ON_SINGLE_SELECTION"

    public static final String PICKER_LAYOUT

    Constant Value: "PICKER_LAYOUT"

    public static final String RECYCLER_ID

    Constant Value: "RECYCLER_ID"

    public static final String SELECTED_ITEM_LABEL

    Constant Value: "LABEL_FOR_SELECTED_ITEM"

    public static final String SELECTED_POS_OR_IDS

    Constant Value: "IDS_FOR_SELECTED_ITEM"

    public static final String SELECTOR_ON_START

    Constant Value: "isSelectorOnStart"

    public static final String SHOW_SELECTED

    Constant Value: "SHOW_SELECTED_ITEM_SECTION"

    public static final String SINGLE_SELECT_ON

    Constant Value: "isSingleSelect"

    public static final String USER_DATA

    Constant Value: "USER_DATA"

    Public Constructors

    public GenericListPickerFormCell (Context context)

    Construct a new GenericListPickerFormCell with default styling, sets the CellType to WidgetType.GENERIC_LISTPICKER

    Parameters
    context context

    public GenericListPickerFormCell (Context context, AttributeSet attrs)

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

    Parameters
    context context
    attrs attribute set

    Public Methods

    public String getActivityTitle ()

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

    Returns
    • String title for the activity on the toolbar

    public int getCellType ()

    Return the enum value for GenericListPickerFormCell

    Returns
    • WidgetType type of the control which has implemented FormCell

    public CellValueChangeListener<List<T>> 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 List<T> 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 isSingleSelectOnly ()

    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 GenericListPickerFormCellActivity

    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<T>> listener)

    Set the CellValueChangeListener to listen to updates to the picker

    Parameters
    listener value change listener of the control

    public void setClearSingleSelection (boolean enable)

    Allow enable of items when already selected item is clicked. Note that this flag only affects the single select picker.

    Parameters
    enable boolean

    public void setDismissOnSingleSelection (boolean dismissOnSingleSelection)

    Automatically dismisses the picker when user selects an item. Works only with Single select picker

    Parameters
    dismissOnSingleSelection should automatically dismiss the picker on single selection

    public void setDisplayValue (CharSequence valueTextField)

    Sets the display value for the selected items

    Parameters
    valueTextField display value for the selected items

    public void setDisplayValueHint (CharSequence hint)

    Set the hint on the display value

    Parameters
    hint hint

    public void setDisplayValueHint (int hint)

    Set the hint on the display value

    Parameters
    hint hint

    public void setDisplayValueTextAppearance (int res)

    Set the display value text appearance

    Parameters
    res style resource

    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 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 setLayoutRes (int layoutRes, int recyclerViewId)

    Set the layout resource and recycler view id to be used to inflate the picker

    Parameters
    layoutRes Layout resource
    recyclerViewId recycler view

    public void setLeftToRight (boolean leftToRight)

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

    Parameters
    leftToRight boolean

    public void setPickerActivity (GenericListPickerFormCellActivity<V, T> listPickerActivity)

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

    Parameters
    listPickerActivity activity for the item list to be displayed

    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 setSingleSelectOnly (boolean enableSingleSelect)

    Enable or disable single/multiple selection

    Parameters
    enableSingleSelect boolean

    public void setValue (List<T> value)

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

    Parameters
    value value of the property
    See Also

    public void showSelected (boolean showSelected)

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

    Parameters
    showSelected boolean

    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 void onSizeChanged (int w, int h, int oldw, int oldh)