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.FilterFormCell

Class Overview

A custom control using either chips or checkboxes for selecting multiple options.

A string array containing names of all items setValueOptions(String[])in and a List of indices of the pre-selected items setValue(List) should be specified.

Summary

XML Attributes
Attribute Name Related Method Description
FilterFormCell_android_enabled setEnabled(boolean)  
FilterFormCell_android_entries  
FilterFormCell_key  
FilterFormCell_outlined  
FilterFormCell_singleLine  
FilterFormCell_useChip  
FilterFormCell_value  
[Expand]
Inherited XML Attributes
From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
[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
FilterFormCell(Context context)
Construct a new FilterFormCell with default styling, sets the CellType to WidgetType.FILTER
FilterFormCell(Context context, AttributeSet attrs)
Construct a new FilterFormCell with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.FILTER
Public Methods
int getCellType()
Return the enum value for FilterFormCell
CellValueChangeListener<List<Integer>> getCellValueChangeListener()
Return the value change handler of the control
CharSequence getError()
Get the error
TextView getErrorView()
CharSequence getHelperText()
Get the helper text from the view
CharSequence getKey()
Return the label of the property of control
TextView getKeyLabel()
Return the view holding the key-name string
List<Integer> getValue()
Returns the index list of selected items in the FilterFormCell
String[] getValueOptions()
Returns an array of items in the Grid
boolean isEditable()
Returns if the control is enabled or not to modify values.
boolean isOutlined()
True when outlined chips are outlined.
boolean isSingleLine()
True when chips are displayed on a single line, that scrolls horizontally.
boolean isUseChip()
True when the filter should display chips, false when it should display check boxes.
void onCheckedChanged(CompoundButton compoundButton, boolean isChecked)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
void setCellValueChangeListener(CellValueChangeListener<List<Integer>> listener)
void setEditable(boolean isEditable)
Set if the control is enabled or not to modify value of the control.
void setEnabled(boolean enabled)
Enable or disable the view
void setError(CharSequence error)
Set the error on the view.
void setErrorEnabled(boolean errorEnabled)
Enable or disable the error field on the view
void setErrorTextAppearance(int resId)
Set the text appearance on the error
void setHelperEnabled(boolean enabled)
Enable or disable the helper field on the view
void setHelperText(CharSequence helper)
Set the helper text on the view
void setHelperTextAppearance(int textAppearance)
Set the helper text appearance
void setKey(CharSequence keyName)
Set the label for property of the control
void setKeyEnabled(boolean keyEnabled)
void setKeyTextAppearance(int resId)
void setOutlined(boolean outlined)
Indicate if chips should be outlined.
void setSingleLine(boolean singleLine)
When set to true, chips will be displayed on a single line that can scroll horizontally when the line is wider than the display.
void setUseChip(boolean useChip)
Set to true to display the filter using chips.
void setValue(List<Integer> value)
Sets the list of index of selected items
void setValueOptions(String[] valueOptions)
Sets the label of options available for the user to choose from
Protected Methods
void adjustMargins()
Calculate and set the margins for the cell's elements.
[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 android.widget.CompoundButton.OnCheckedChangeListener
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.SupportsHelperText
From interface com.sap.cloud.mobile.fiori.formcell.SupportsKey

XML Attributes

FilterFormCell_android_enabled

Related Methods

FilterFormCell_android_entries

Related Methods

FilterFormCell_key

Related Methods

FilterFormCell_outlined

Related Methods

FilterFormCell_singleLine

Related Methods

FilterFormCell_useChip

Related Methods

FilterFormCell_value

Related Methods

Public Constructors

public FilterFormCell (Context context)

Construct a new FilterFormCell with default styling, sets the CellType to WidgetType.FILTER

Parameters
context context

public FilterFormCell (Context context, AttributeSet attrs)

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

Parameters
context context
attrs attribute set

Public Methods

public int getCellType ()

Return the enum value for FilterFormCell

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 getError ()

Get the error

Returns
  • CharSequence

public TextView getErrorView ()

public CharSequence getHelperText ()

Get the helper text from the view

Returns
  • CharSequence

public CharSequence getKey ()

Return the label of the property of control

Returns
  • CharSequence keyName

public TextView getKeyLabel ()

Return the view holding the key-name string

Returns
  • TextView text-view displaying key-name

public List<Integer> getValue ()

Returns the index list of selected items in the FilterFormCell

Returns
  • List index of selected items

public String[] getValueOptions ()

Returns an array of items in the Grid

Returns
  • String[] itemNames in the Grid

public boolean isEditable ()

Returns if the control is enabled or not to modify values.

Returns
  • Boolean user is allowed to modify the value of the control

public boolean isOutlined ()

True when outlined chips are outlined.

Returns
  • true when outlined chips are outlined.

public boolean isSingleLine ()

True when chips are displayed on a single line, that scrolls horizontally. Otherwise, chips are displayed on multiple lines.

Returns
  • true when chips are displayed on a single line, or false when chips are displayed on multiple lines.

public boolean isUseChip ()

True when the filter should display chips, false when it should display check boxes.

Returns
  • true when the filter should display chips, false when it should display check boxes.

public void onCheckedChanged (CompoundButton compoundButton, boolean isChecked)

public void onRestoreInstanceState (Parcelable state)

public Parcelable onSaveInstanceState ()

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

public void setEditable (boolean isEditable)

Set if the control is enabled or not to modify value of the control. In readOnly mode, however, the text labels and text values will be selectable. By default, the control will be editable( user can modify value of the control)

Parameters
isEditable Boolean

public void setEnabled (boolean enabled)

Enable or disable the view

Related XML Attributes
Parameters
enabled boolean

public void setError (CharSequence error)

Set the error on the view. If the view is not error enabled then this API does not take any effect.

Parameters
error CharSequence

public void setErrorEnabled (boolean errorEnabled)

Enable or disable the error field on the view

Parameters
errorEnabled boolean

public void setErrorTextAppearance (int resId)

Set the text appearance on the error

Parameters
resId style resource

public void setHelperEnabled (boolean enabled)

Enable or disable the helper field on the view

Parameters
enabled boolean

public void setHelperText (CharSequence helper)

Set the helper text on the view

Parameters
helper CharSequence

public void setHelperTextAppearance (int textAppearance)

Set the helper text appearance

Parameters
textAppearance style resource

public void setKey (CharSequence keyName)

Set the label for property of the control

Parameters
keyName label of the property

public void setKeyEnabled (boolean keyEnabled)

public void setKeyTextAppearance (int resId)

public void setOutlined (boolean outlined)

Indicate if chips should be outlined. This method only has an affect when useChip is true.

Parameters
outlined true to outline chips, otherwise chips are not outlined.

public void setSingleLine (boolean singleLine)

When set to true, chips will be displayed on a single line that can scroll horizontally when the line is wider than the display. When set to false, chips will be displayed on multiple lines. This method only has an affect when useChip is true.

Parameters
singleLine true to display chips on a single line, false to display chips on multiple lines.

public void setUseChip (boolean useChip)

Set to true to display the filter using chips. False to display the filter using check boxes.

Parameters
useChip true to display the filter using chips. False to display the filter using check boxes.

public void setValue (List<Integer> value)

Sets the list of index of selected items

Parameters
value value of the property

public void setValueOptions (String[] valueOptions)

Sets the label of options available for the user to choose from

Parameters
valueOptions item list

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.