public class

SimplePropertyFormCell

extends LinearLayout
implements FormCell<T> InlineValidation SupportsHelperText SupportsKey
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.sap.cloud.mobile.fiori.formcell.SimplePropertyFormCell
Known Direct Subclasses

Class Overview

SimplePropertyFormCell is a simple form cell with a key and editable, single line value field.

Structure of the control :

  • Key : Acts as key/tag or name for the view. For example travel date, meeting etc. See also : setKey(CharSequence)
  • Value : Value of the cell as CharSequence See also: setValue(CharSequence)
  • Summary

    Nested Classes
    enum SimplePropertyFormCell.SecondaryActionType  
    XML Attributes
    Attribute Name Related Method Description
    SimplePropertyFormCell_android_ellipsize  
    SimplePropertyFormCell_android_enabled  
    SimplePropertyFormCell_android_hint  
    SimplePropertyFormCell_android_imeOptions  
    SimplePropertyFormCell_android_inputType  
    SimplePropertyFormCell_android_maxLines  
    SimplePropertyFormCell_android_textColorHint  
    SimplePropertyFormCell_android_textIsSelectable setTextIsSelectable(boolean)  
    SimplePropertyFormCell_error  
    SimplePropertyFormCell_errorEnabled setErrorEnabled(boolean)  
    SimplePropertyFormCell_errorTextAppearance  
    SimplePropertyFormCell_helperEnabled setHelperEnabled(boolean)  
    SimplePropertyFormCell_helperText setHelperText(CharSequence)  
    SimplePropertyFormCell_helperTextTextAppearance setHelperTextAppearance(int)  
    SimplePropertyFormCell_isEditable setEditable(boolean)  
    SimplePropertyFormCell_key setKey(CharSequence)  
    SimplePropertyFormCell_keyTextAppearance setKeyTextAppearance(int)  
    SimplePropertyFormCell_keyTextAppearanceFocused setKeyTextAppearanceFocused(int)  
    SimplePropertyFormCell_keyTextAppearanceUnFocused setKeyTextAppearanceUnFocused(int)  
    SimplePropertyFormCell_prefixText  
    SimplePropertyFormCell_prefixTextColor  
    SimplePropertyFormCell_requiredField setRequiredField(boolean)  
    SimplePropertyFormCell_secondaryActionType  
    SimplePropertyFormCell_suffixText  
    SimplePropertyFormCell_suffixTextColor  
    SimplePropertyFormCell_value setValue(CharSequence)  
    SimplePropertyFormCell_valueTextAppearance setValueTextAppearance(int)  
    TextInputLayout_endIconDrawable setSecondaryActionIcon(Drawable)  
    [Expand]
    Inherited Constants
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    Fields
    protected final TextInputLayout mSimplePropertyCellTextInputLayout
    protected final TextInputEditText mSimplePropertyTextInputEditText
    [Expand]
    Inherited Fields
    From class android.view.View
    Public Constructors
    SimplePropertyFormCell(Context context)
    SimplePropertyFormCell(Context context, AttributeSet attrs)
    SimplePropertyFormCell(Context context, AttributeSet attrs, int defStyleAttr)
    SimplePropertyFormCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
    Public Methods
    boolean dispatchKeyEvent(KeyEvent event)
    boolean dispatchTouchEvent(MotionEvent event)
    int getCellType()
    Get cell widget type from FormCell.WidgetType
    CellValueChangeListener<CharSequence> getCellValueChangeListener()
    Get the subscribed CellValueChangeListener on the cell.
    CharSequence getError()
    Get the error text from the view
    TextView getErrorView()
    Get the error view.
    CharSequence getHelperText()
    Get the helper text from the view
    CharSequence getKey()
    Get Key property of the cell
    TextView getKeyView()
    Get the key view.
    CharSequence getPrefixText()
    Returns the prefix text that was set to be displayed with setPrefixText(CharSequence), or null if there is no prefix text.
    CharSequence getSuffixText()
    Returns the suffix text that was set to be displayed with setSuffixText(CharSequence), or null if there is no suffix text.
    CharSequence getValue()
    Get the value property of the cell
    EditText getValueView()
    Get the value view.
    boolean isEditable()
    Get if the cell is editable.
    boolean isErrorEnabled()
    Is error enabled on the view
    boolean isHelperEnabled()
    Returns whether the helper text functionality is enabled or not.
    boolean isHelperTextEnabled()
    Returns whether the helper text functionality is enabled or not.
    boolean isIsRequiredField()
    Returns whether this cell has been set as a required field.
    boolean isPasswordToggleEnabled()
    Returns whether the password visibility toggle functionality is currently enabled.
    void setBoxStrokeColor(ColorStateList color)
    Set the box's stroke color
    void setBoxStrokeColorFocused(int color)
    Set the box's stroke color when focused
    void setBoxStrokeErrorColor(int color)
    Set the box's stroke color when in error state
    void setBoxStrokeErrorColor(ColorStateList color)
    Set the box's stroke color when in error state
    void setCellValueChangeListener(CellValueChangeListener<CharSequence> listener)
    Subscribe to the changes of the cell value.
    void setContentDescription(CharSequence contentDescription)
    Set content description for entire cell

    Note: Setting this does not change the content description of the edit text.

    void setEditTextContentDescription(CharSequence contentDescription)
    Set content description for the edit text field

    Note: Setting this does not change the content description of the entire cell.

    void setEditable(boolean isEditable)
    Change the editable property of the cell value.
    void setEllipsize(TextUtils.TruncateAt at)
    Set the ellipsize location when the cell can not accommodate all of the cell value.
    void setEnabled(boolean enabled)
    Set the enabled state of this cell.
    void setError(CharSequence error)
    Set the error text if view is error enabled
    void setErrorEnabled(boolean enabled)
    Enable or disable the error field on the view
    void setErrorTextAppearance(int errorTextAppearance)
    Set the error text appearance on the view
    void setErrorTextColor(int color)
    Set text color of the error text
    void setErrorTextColor(ColorStateList color)
    Set text color of the error text
    void setHelperEnabled(boolean enabled)
    Enable or disable the helper field on the view
    void setHelperText(CharSequence helperText)
    Set the helper text on the view
    void setHelperTextAppearance(int helperTextAppearance)
    Set the helper text appearance
    void setHelperTextColor(int color)
    Set text color of the helper text
    void setHelperTextColor(ColorStateList color)
    Set text color of the helper text
    void setHint(CharSequence hint)
    Set the hint on the SimplePropertyForm cell
    void setHintTextColor(ColorStateList color)
    Set the color of the hint text
    void setHintTextColor(int color)
    Set the color of the hint text
    void setImeOptions(int imeOptions)
    Set the ime options on the SimplePropertyFormCell
    void setInputType(int type)
    Change the input type of the cell if the cell is editable.
    void setKey(CharSequence key)
    Set the key property of the cell
    void setKeyTextAppearance(int keyTextAppearance)
    Set the text appearance of the Key of the cell.
    void setKeyTextAppearanceFocused(int keyTextAppearanceFocused)
    Set the text appearance of the Key of the cell when focused
    void setKeyTextAppearanceUnFocused(int keyTextAppearanceUnFocused)
    Set the text appearance of the Key of the cell when not focused
    void setKeyTextColorError(ColorStateList color)
    Set the color of the key when in error state
    void setKeyTextColorError(int color)
    Set the color of the key when in error state
    void setKeyTextColorFocused(ColorStateList color)
    Set the color of key when the view is focused
    void setKeyTextColorFocused(int color)
    Set the color of key when the view is focused
    void setKeyTextColorUnFocused(int color)
    Set the color of key when the view is not focused
    void setKeyTextColorUnFocused(ColorStateList color)
    Set the color of key when the view is not focused
    void setLines(int lines)
    Sets the height of the input text view to be exactly lines tall.
    void setMaxLines(int maxLines)
    Set maximum number of lines
    void setMinLines(int minLines)
    Set minimum number of lines on the value
    void setPrefixText(CharSequence prefixText)
    Sets prefix text that will be displayed in the input area when the hint is collapsed before text is entered.
    void setPrefixTextColor(ColorStateList color)
    Set the color of the prefix text
    void setRequiredField(boolean requiredField)
    Sets this cell as a required field.
    void setSecondaryActionIcon(Drawable drawable)
    Set the icon to use for the secondary action.
    void setSecondaryActionIconContentDescription(CharSequence contentDescription)
    Set a content description for the secondary action icon.
    void setSecondaryActionIconTintList(ColorStateList endIconTintList)
    Applies a tint to the secondary action icon drawable.
    void setSecondaryActionOnClickListener(View.OnClickListener clickListener)
    Override the default action for the secondary action button.
    void setSecondaryActionType(SimplePropertyFormCell.SecondaryActionType secondaryActionType)
    Set the secondary action type.
    void setSingleLine(boolean isSingleLine)
    Enable single line only
    void setSuffixText(CharSequence suffixText)
    Sets suffix text that will be displayed in the input area when the hint is collapsed before text is entered.
    void setSuffixTextColor(ColorStateList color)
    Set the color of the suffix text
    void setTextIsSelectable(boolean isSelectable)
    Make the value field of the text selectable or un-selectable
    void setValue(CharSequence value)
    Set the value property of the cell
    void setValueOnFocusChangeListener(View.OnFocusChangeListener listener)
    Set the on focus change listener on value field.
    void setValueOnTouchListener(View.OnTouchListener listener)
    Set the touch listener on value field.
    void setValueTextAppearance(int valueTextAppearance)
    Set the text appearance of the value field using given resource.
    void setValueTextColor(ColorStateList color)
    Set the text color of the value field
    void setValueTextColor(int color)
    Set the text color of the value field
    void setValueTypefaceStyle(int style)
    Set the typeface for the value field
    Protected Methods
    void dispatchRestoreInstanceState(SparseArray<Parcelable> container)
    void dispatchSaveInstanceState(SparseArray<Parcelable> container)
    void drawableStateChanged()
    void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    [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.SupportsHelperText
    From interface com.sap.cloud.mobile.fiori.formcell.SupportsKey

    XML Attributes

    SimplePropertyFormCell_android_ellipsize

    Related Methods

    SimplePropertyFormCell_android_enabled

    Related Methods

    SimplePropertyFormCell_android_hint

    Related Methods

    SimplePropertyFormCell_android_imeOptions

    Related Methods

    SimplePropertyFormCell_android_inputType

    Related Methods

    SimplePropertyFormCell_android_maxLines

    Related Methods

    SimplePropertyFormCell_android_textColorHint

    Related Methods

    SimplePropertyFormCell_android_textIsSelectable

    SimplePropertyFormCell_error

    Related Methods

    SimplePropertyFormCell_errorEnabled

    Related Methods

    SimplePropertyFormCell_errorTextAppearance

    Related Methods

    SimplePropertyFormCell_helperEnabled

    Related Methods

    SimplePropertyFormCell_helperText

    Related Methods

    SimplePropertyFormCell_helperTextTextAppearance

    SimplePropertyFormCell_isEditable

    Related Methods

    SimplePropertyFormCell_key

    Related Methods

    SimplePropertyFormCell_keyTextAppearance

    Related Methods

    SimplePropertyFormCell_keyTextAppearanceFocused

    SimplePropertyFormCell_keyTextAppearanceUnFocused

    SimplePropertyFormCell_prefixText

    Related Methods

    SimplePropertyFormCell_prefixTextColor

    Related Methods

    SimplePropertyFormCell_requiredField

    Related Methods

    SimplePropertyFormCell_secondaryActionType

    Related Methods

    SimplePropertyFormCell_suffixText

    Related Methods

    SimplePropertyFormCell_suffixTextColor

    Related Methods

    SimplePropertyFormCell_value

    Related Methods

    SimplePropertyFormCell_valueTextAppearance

    Related Methods

    TextInputLayout_endIconDrawable

    Fields

    protected final TextInputLayout mSimplePropertyCellTextInputLayout

    protected final TextInputEditText mSimplePropertyTextInputEditText

    Public Constructors

    public SimplePropertyFormCell (Context context)

    public SimplePropertyFormCell (Context context, AttributeSet attrs)

    public SimplePropertyFormCell (Context context, AttributeSet attrs, int defStyleAttr)

    public SimplePropertyFormCell (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

    Public Methods

    public boolean dispatchKeyEvent (KeyEvent event)

    public boolean dispatchTouchEvent (MotionEvent event)

    public int getCellType ()

    Get cell widget type from FormCell.WidgetType

    Returns
    • int

    public CellValueChangeListener<CharSequence> getCellValueChangeListener ()

    Get the subscribed CellValueChangeListener on the cell.

    public CharSequence getError ()

    Get the error text from the view

    Returns
    • CharSequence

    public TextView getErrorView ()

    Get the error view. Not supported.

    Returns
    • TextView

    public CharSequence getHelperText ()

    Get the helper text from the view

    Related XML Attributes
    Returns
    • CharSequence

    public CharSequence getKey ()

    Get Key property of the cell

    Returns
    • CharSequence

    public TextView getKeyView ()

    Get the key view. This API should only be used for testing. You should not create production code using this API.

    Returns
    • TextView

    public CharSequence getPrefixText ()

    Returns the prefix text that was set to be displayed with setPrefixText(CharSequence), or null if there is no prefix text.

    public CharSequence getSuffixText ()

    Returns the suffix text that was set to be displayed with setSuffixText(CharSequence), or null if there is no suffix text.

    public CharSequence getValue ()

    Get the value property of the cell

    Related XML Attributes
    Returns
    • CharSequence

    public EditText getValueView ()

    Get the value view. This API should only be used for testing. You should not create production code using this API.

    Returns
    • EditText

    public boolean isEditable ()

    Get if the cell is editable.

    Related XML Attributes
    Returns
    • boolean

    public boolean isErrorEnabled ()

    Is error enabled on the view

    Related XML Attributes
    Returns
    • boolean

    public boolean isHelperEnabled ()

    Returns whether the helper text functionality is enabled or not.

    public boolean isHelperTextEnabled ()

    Returns whether the helper text functionality is enabled or not.

    public boolean isIsRequiredField ()

    Returns whether this cell has been set as a required field.

    public boolean isPasswordToggleEnabled ()

    Returns whether the password visibility toggle functionality is currently enabled.

    public void setBoxStrokeColor (ColorStateList color)

    Set the box's stroke color

    Parameters
    color ColorStateList

    public void setBoxStrokeColorFocused (int color)

    Set the box's stroke color when focused

    Parameters
    color color resource

    public void setBoxStrokeErrorColor (int color)

    Set the box's stroke color when in error state

    Parameters
    color color resource

    public void setBoxStrokeErrorColor (ColorStateList color)

    Set the box's stroke color when in error state

    Parameters
    color ColorStateList

    public void setCellValueChangeListener (CellValueChangeListener<CharSequence> listener)

    Subscribe to the changes of the cell value.

    Parameters
    listener value change listener

    public void setContentDescription (CharSequence contentDescription)

    Set content description for entire cell

    Note: Setting this does not change the content description of the edit text. Use setEditTextContentDescription(CharSequence) to achieve that

    Parameters
    contentDescription the content description to be set

    public void setEditTextContentDescription (CharSequence contentDescription)

    Set content description for the edit text field

    Note: Setting this does not change the content description of the entire cell. Use setContentDescription(CharSequence) to achieve that

    Parameters
    contentDescription the content description to be set

    public void setEditable (boolean isEditable)

    Change the editable property of the cell value. Unlike other form cells, SimplePropertyFormCell remains enabled when set to non-editable. In non editable mode you cannot change the value of the Cell, however you can set the property to be selectable or un-selectable.

    Note: If an editable cell is changed to become non-editable, you will have to explicitly set setSingleLine(boolean) to false if you want the cell to expand to show its entire contents rather than in a single line. You might also have to set setTextIsSelectable(boolean) to true if you would like the text to be selectable if it is not already. Calling either of those methods may lead to the cell value change listeners to be called

    Related XML Attributes
    Parameters
    isEditable boolean
    See Also

    public void setEllipsize (TextUtils.TruncateAt at)

    Set the ellipsize location when the cell can not accommodate all of the cell value.

    public void setEnabled (boolean enabled)

    Set the enabled state of this cell.

    Parameters
    enabled True if this cell is enabled, false otherwise.

    public void setError (CharSequence error)

    Set the error text if view is error enabled

    Parameters
    error CharSequence

    public void setErrorEnabled (boolean enabled)

    Enable or disable the error field on the view

    Related XML Attributes
    Parameters
    enabled boolean
    See Also

    public void setErrorTextAppearance (int errorTextAppearance)

    Set the error text appearance on the view

    Parameters
    errorTextAppearance text appearance error

    public void setErrorTextColor (int color)

    Set text color of the error text

    Parameters
    color color resource

    public void setErrorTextColor (ColorStateList color)

    Set text color of the error text

    Parameters
    color ColorStateList

    public void setHelperEnabled (boolean enabled)

    Enable or disable the helper field on the view

    Related XML Attributes
    Parameters
    enabled boolean
    See Also

    public void setHelperText (CharSequence helperText)

    Set the helper text on the view

    Related XML Attributes
    Parameters
    helperText CharSequence
    See Also

    public void setHelperTextAppearance (int helperTextAppearance)

    Set the helper text appearance

    Parameters
    helperTextAppearance style resource

    public void setHelperTextColor (int color)

    Set text color of the helper text

    Parameters
    color color resource

    public void setHelperTextColor (ColorStateList color)

    Set text color of the helper text

    Parameters
    color ColorStateList

    public void setHint (CharSequence hint)

    Set the hint on the SimplePropertyForm cell

    Parameters
    hint String

    public void setHintTextColor (ColorStateList color)

    Set the color of the hint text

    Parameters
    color ColorStateList

    public void setHintTextColor (int color)

    Set the color of the hint text

    Parameters
    color color resource

    public void setImeOptions (int imeOptions)

    Set the ime options on the SimplePropertyFormCell

    Parameters
    imeOptions ime options

    public void setInputType (int type)

    Change the input type of the cell if the cell is editable. Please note that if the cell is not editable or if no InputType class (TYPE_CLASS_TEXT, TYPE_CLASS_NUMBER, TYPE_CLASS_PHONE, TYPE_CLASS_DATETIME) is specified, then this method has no effect.

    Parameters
    type int

    public void setKey (CharSequence key)

    Set the key property of the cell

    Related XML Attributes
    Parameters
    key label of the property
    See Also

    public void setKeyTextAppearance (int keyTextAppearance)

    Set the text appearance of the Key of the cell. This api overrides the text appearance of the key in both focused and unfocused states.

    Parameters
    keyTextAppearance style resource

    public void setKeyTextAppearanceFocused (int keyTextAppearanceFocused)

    Set the text appearance of the Key of the cell when focused

    Parameters
    keyTextAppearanceFocused style resource

    public void setKeyTextAppearanceUnFocused (int keyTextAppearanceUnFocused)

    Set the text appearance of the Key of the cell when not focused

    Parameters
    keyTextAppearanceUnFocused style resource

    public void setKeyTextColorError (ColorStateList color)

    Set the color of the key when in error state

    Parameters
    color ColorStateList

    public void setKeyTextColorError (int color)

    Set the color of the key when in error state

    Parameters
    color color resource

    public void setKeyTextColorFocused (ColorStateList color)

    Set the color of key when the view is focused

    Parameters
    color ColorStateList

    public void setKeyTextColorFocused (int color)

    Set the color of key when the view is focused

    Parameters
    color color resource

    public void setKeyTextColorUnFocused (int color)

    Set the color of key when the view is not focused

    Parameters
    color color resource

    public void setKeyTextColorUnFocused (ColorStateList color)

    Set the color of key when the view is not focused

    Parameters
    color ColorStateList

    public void setLines (int lines)

    Sets the height of the input text view to be exactly lines tall.

    Parameters
    lines the exact height of the TextView in terms of lines

    public void setMaxLines (int maxLines)

    Set maximum number of lines

    Parameters
    maxLines int

    public void setMinLines (int minLines)

    Set minimum number of lines on the value

    Parameters
    minLines int

    public void setPrefixText (CharSequence prefixText)

    Sets prefix text that will be displayed in the input area when the hint is collapsed before text is entered. If the prefix is null, any previous prefix text will be hidden and no prefix text will be shown.

    Parameters
    prefixText Prefix text to display
    See Also

    public void setPrefixTextColor (ColorStateList color)

    Set the color of the prefix text

    Parameters
    color colorStateList

    public void setRequiredField (boolean requiredField)

    Sets this cell as a required field.

    When enabled, an "*" is appended to the key to indicate that the cell is a required field.

    Related XML Attributes
    Parameters
    requiredField true to enable the functionality

    public void setSecondaryActionIcon (Drawable drawable)

    Set the icon to use for the secondary action.

    If you use an icon you should also set a description for its action using setSecondaryActionIconContentDescription(CharSequence). This is used for accessibility.

    Related XML Attributes
    Parameters
    drawable Drawable to set, may be null to clear the icon

    public void setSecondaryActionIconContentDescription (CharSequence contentDescription)

    Set a content description for the secondary action icon.

    Parameters
    contentDescription Content description to set

    public void setSecondaryActionIconTintList (ColorStateList endIconTintList)

    Applies a tint to the secondary action icon drawable.

    Parameters
    endIconTintList the tint to apply, may be null to clear tint

    public void setSecondaryActionOnClickListener (View.OnClickListener clickListener)

    Override the default action for the secondary action button.

    Parameters
    clickListener that overridden action to take when the secondary action button is clicked.

    public void setSecondaryActionType (SimplePropertyFormCell.SecondaryActionType secondaryActionType)

    Set the secondary action type. The default secondary action type is NONE. Changing the type adds a type specific icon, and may add a default action when the secondary action button is tapped. BARCODE and PASSWORD have default actions.

    Parameters
    secondaryActionType the type to set for the secondary action button.

    public void setSingleLine (boolean isSingleLine)

    Enable single line only

    Parameters
    isSingleLine boolean

    public void setSuffixText (CharSequence suffixText)

    Sets suffix text that will be displayed in the input area when the hint is collapsed before text is entered. If the suffix is null, any previous suffix text will be hidden and no suffix text will be shown.

    Parameters
    suffixText Suffix text to display
    See Also

    public void setSuffixTextColor (ColorStateList color)

    Set the color of the suffix text

    Parameters
    color colorStateList

    public void setTextIsSelectable (boolean isSelectable)

    Make the value field of the text selectable or un-selectable

    Parameters
    isSelectable boolean

    public void setValue (CharSequence value)

    Set the value property of the cell

    Related XML Attributes
    Parameters
    value value as CharSequence
    See Also

    public void setValueOnFocusChangeListener (View.OnFocusChangeListener listener)

    Set the on focus change listener on value field.

    Parameters
    listener OnFocusChangeListener

    public void setValueOnTouchListener (View.OnTouchListener listener)

    Set the touch listener on value field.

    Parameters
    listener OnTouchListener

    public void setValueTextAppearance (int valueTextAppearance)

    Set the text appearance of the value field using given resource.

    Parameters
    valueTextAppearance style resource

    public void setValueTextColor (ColorStateList color)

    Set the text color of the value field

    Parameters
    color ColorStateList

    public void setValueTextColor (int color)

    Set the text color of the value field

    Parameters
    color color resource

    public void setValueTypefaceStyle (int style)

    Set the typeface for the value field

    Parameters
    style style resource

    Protected Methods

    protected void dispatchRestoreInstanceState (SparseArray<Parcelable> container)

    protected void dispatchSaveInstanceState (SparseArray<Parcelable> container)

    protected void drawableStateChanged ()

    protected void onFocusChanged (boolean gainFocus, int direction, Rect previouslyFocusedRect)

    protected void onRestoreInstanceState (Parcelable state)

    protected Parcelable onSaveInstanceState ()