java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.sap.cloud.mobile.fiori.formcell.MultiSortFormCell

Class Overview

A custom control providing options to choose and order multiple user choices Typical use case is to specify the choices and order of sorting algorithms.

A list of strings containing names of all user choices setValueOptions(List)should be specified.

Summary

XML Attributes
Attribute Name Related Method Description
FormCellMetadataLayout_android_clickable setClickable(boolean)  
FormCellMetadataLayout_android_focusable setFocusable(boolean)  
FormCellMetadataLayout_errorEnabled isErrorEnabled()  
FormCellMetadataLayout_helperEnabled isHelperEnabled()  
FormCellMetadataLayout_label setLabel(CharSequence)  
FormCellMetadataLayout_labelEnabled setLabelEnabled(boolean)  
FormCellMetadataLayout_labelTextAppearance setLabelTextAppearanceFocused(int)  
FormCellMetadataLayout_labelTextAppearanceFocused setLabelTextAppearanceFocused(int)  
FormCellMetadataLayout_labelTextAppearanceUnFocused setLabelTextAppearanceFocused(int)  
MultiSortFormCell_android_enabled setEnabled(boolean)  
MultiSortFormCell_android_entries setValueOptions(List)  
MultiSortFormCell_error setError(CharSequence)  
MultiSortFormCell_errorEnabled setErrorEnabled(boolean)  
MultiSortFormCell_errorTextAppearance setErrorTextAppearance(int)  
MultiSortFormCell_helperEnabled setHelperEnabled(boolean)  
MultiSortFormCell_helperText setHelperText(CharSequence)  
MultiSortFormCell_helperTextAppearance setHelperTextAppearance(int)  
MultiSortFormCell_isEditable setEditable(boolean)  
MultiSortFormCell_key  
MultiSortFormCell_keyEnabled setKeyEnabled(boolean)  
MultiSortFormCell_value setValue(List)  
[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
MultiSortFormCell(Context context)
Construct a new FilterFormCell with default styling, sets the CellType to WidgetType.FILTER
MultiSortFormCell(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
void addView(View child, int index, ViewGroup.LayoutParams params)
Add given view in the view
int getCellType()
Get the widget type of the cell
CellValueChangeListener<List<String>> getCellValueChangeListener()
Get the ERROR(/CellValueChangeListener) on the cell
CharSequence getError()
Get the error message from the cell
TextView getErrorView()
CharSequence getHelperText()
Get the helper text set on the cell
CharSequence getKey()
Get the key set on the cell
TextView getKeyLabel()
Return the view holding the key-name string
List<Pair<StringString>> getToggles()
HashMap<StringBoolean> getTogglesStates()
List<String> getValue()
Returns an ordered list of options chosen by user
List<String> getValueOptions()
boolean isEditable()
Is the cell 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
void onCheckedChanged(CompoundButton compoundButton, boolean isChecked)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
void setCellValueChangeListener(CellValueChangeListener<List<String>> listener)
void setClickable(boolean clickable)
Enable or disable clickable property on the view and all its children
void setEditable(boolean isEditable)
Set if the cell is editable
void setEnabled(boolean enabled)
Enable or disable the view
void setError(CharSequence error)
set the error on the cell
void setErrorEnabled(boolean errorEnabled)
Set if cell supports error messages
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 setHelperEnabled(boolean enabled)
Set if the cell supports helper text
void setHelperText(CharSequence helper)
Set the helper text on the cell
void setHelperTextAppearance(int textAppearance)
Set the text appearance for the helper text
void setKey(CharSequence keyName)
Set the key on the cell
void setKeyEnabled(boolean keyEnabled)
Set if cell supports key message
void setKeyTextAppearance(int resId)
Set the text appearance on the cell
void setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
Set the label text appearance when the view is not focused
void setOverrideKeyStyle(boolean overrideKeyStyle)
Override the Key styling manually.
void setOverrideStatusStyle(boolean overrideStatusStyle)
Override the status i.e.
void setShouldAttachOrientationListener(boolean shouldAttach)
Determines if an OrientationEventListener should be attached.
void setToggles(List<Pair<StringString>> toggles)
void setTogglesStates(Map<StringBoolean> states)
void setValue(List<String> value)
Sets the ordered list of options as preselected
void setValueOptions(List<String> valueOptions)
Sets the list of options available to the user to choose from
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 getLabel()
Get the label on the view
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 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 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

FormCellMetadataLayout_android_clickable

Related Methods

FormCellMetadataLayout_android_focusable

Related Methods

FormCellMetadataLayout_errorEnabled

Related Methods

FormCellMetadataLayout_helperEnabled

Related Methods

FormCellMetadataLayout_label

Related Methods

FormCellMetadataLayout_labelEnabled

Related Methods

FormCellMetadataLayout_labelTextAppearance

FormCellMetadataLayout_labelTextAppearanceFocused

FormCellMetadataLayout_labelTextAppearanceUnFocused

MultiSortFormCell_android_enabled

Related Methods

MultiSortFormCell_android_entries

Related Methods

MultiSortFormCell_error

Related Methods

MultiSortFormCell_errorEnabled

Related Methods

MultiSortFormCell_errorTextAppearance

Related Methods

MultiSortFormCell_helperEnabled

Related Methods

MultiSortFormCell_helperText

Related Methods

MultiSortFormCell_helperTextAppearance

MultiSortFormCell_isEditable

Related Methods

MultiSortFormCell_key

Related Methods

MultiSortFormCell_keyEnabled

Related Methods

MultiSortFormCell_value

Related Methods

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 MultiSortFormCell (Context context)

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

Parameters
context context

public MultiSortFormCell (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 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 int getCellType ()

Get the widget type of the cell

Returns
  • WidgetType type of the control

public CellValueChangeListener<List<String>> getCellValueChangeListener ()

Get the ERROR(/CellValueChangeListener) on the cell

Returns
  • OnCellChangeListener - value change listener of the control

public CharSequence getError ()

Get the error message from the cell

Related XML Attributes
Returns
  • CharSequence

public TextView getErrorView ()

public CharSequence getHelperText ()

Get the helper text set on the cell

Returns
  • CharSequence

public CharSequence getKey ()

Get the key set on the cell

Returns
  • CharSequence keyName

public TextView getKeyLabel ()

Return the view holding the key-name string

Returns
  • TextView text-view displaying key-name

public List<Pair<StringString>> getToggles ()

public HashMap<StringBoolean> getTogglesStates ()

public List<String> getValue ()

Returns an ordered list of options chosen by user

Returns
  • T - value of the property

public List<String> getValueOptions ()

public boolean isEditable ()

Is the cell editable

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

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 void onCheckedChanged (CompoundButton compoundButton, boolean isChecked)

public void onRestoreInstanceState (Parcelable state)

public Parcelable onSaveInstanceState ()

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

public void setClickable (boolean clickable)

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

Parameters
clickable boolean

public void setEditable (boolean isEditable)

Set if the cell is editable

Related XML Attributes
Parameters
isEditable Boolean
See Also

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 cell

Related XML Attributes
Parameters
error CharSequence
See Also

public void setErrorEnabled (boolean errorEnabled)

Set if cell supports error messages

Related XML Attributes
Parameters
errorEnabled boolean

public void setErrorTextAppearance (int resId)

Set the error text appearance

Related XML Attributes
Parameters
resId style resource

public void setFocusable (boolean focusable)

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

Parameters
focusable boolean

public void setHelperEnabled (boolean enabled)

Set if the cell supports helper text

Related XML Attributes
Parameters
enabled boolean

public void setHelperText (CharSequence helper)

Set the helper text on the cell

Related XML Attributes
Parameters
helper CharSequence

public void setHelperTextAppearance (int textAppearance)

Set the text appearance for the helper text

Parameters
textAppearance style resource

public void setKey (CharSequence keyName)

Set the key on the cell

Parameters
keyName label of the property
See Also

public void setKeyEnabled (boolean keyEnabled)

Set if cell supports key message

Related XML Attributes

public void setKeyTextAppearance (int resId)

Set the text appearance on the cell

public void setLabelTextAppearanceUnFocused (int labelTextAppearanceUnFocused)

Set the label text appearance when the view is not focused

Parameters
labelTextAppearanceUnFocused Style resource

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 setShouldAttachOrientationListener (boolean shouldAttach)

Determines if an OrientationEventListener should be attached.

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

public void setToggles (List<Pair<StringString>> toggles)

public void setTogglesStates (Map<StringBoolean> states)

public void setValue (List<String> value)

Sets the ordered list of options as preselected

Related XML Attributes

public void setValueOptions (List<String> valueOptions)

Sets the list of options available to the user to choose from

Related XML Attributes

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

Get the label on the view

Related XML Attributes
Returns
  • CharSequence

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