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 : Label view 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
    FormCellMetadataLayout_android_clickable setClickable(boolean)  
    FormCellMetadataLayout_android_focusable setFocusable(boolean)  
    FormCellMetadataLayout_errorEnabled isErrorEnabled()  
    FormCellMetadataLayout_helperEnabled isHelperEnabled()  
    FormCellMetadataLayout_label setLabel(CharSequence)  
    FormCellMetadataLayout_labelEnabled isLabelEnabled()  
    FormCellMetadataLayout_labelTextAppearance setLabelTextAppearanceFocused(int)  
    FormCellMetadataLayout_labelTextAppearanceFocused setLabelTextAppearanceFocused(int)  
    FormCellMetadataLayout_labelTextAppearanceUnFocused setLabelTextAppearanceFocused(int)  
    SimplePropertyFormCell_android_ellipsize  
    SimplePropertyFormCell_android_enabled  
    SimplePropertyFormCell_android_hint  
    SimplePropertyFormCell_android_inputType  
    SimplePropertyFormCell_android_maxLines  
    SimplePropertyFormCell_android_singleLine  
    SimplePropertyFormCell_android_textColorHint  
    SimplePropertyFormCell_android_textIsSelectable setTextIsSelectable(boolean)  
    SimplePropertyFormCell_isEditable setEditable(boolean)  
    SimplePropertyFormCell_key setKey(CharSequence)  
    SimplePropertyFormCell_keyTextAppearance setKeyTextAppearance(int)  
    SimplePropertyFormCell_keyTextAppearanceFocused setKeyTextAppearanceFocused(int)  
    SimplePropertyFormCell_keyTextAppearanceUnFocused setKeyTextAppearanceUnFocused(int)  
    SimplePropertyFormCell_lines  
    SimplePropertyFormCell_value setValue(CharSequence)  
    SimplePropertyFormCell_valueTextAppearance setValueTextAppearance(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
    protected final AppCompatEditText mValue
    [Expand]
    Inherited Fields
    From class android.view.View
    Public Constructors
    SimplePropertyFormCell(Context context)
    SimplePropertyFormCell(Context context, AttributeSet attrs)
    Public Methods
    void addView(View child, int index, ViewGroup.LayoutParams params)
    Add given view in the view
    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
    CharSequence getKey()
    Get Key property of the cell
    TextView getKeyView()
    Get the key view.
    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()
    Set if the helper field is enabled on the view
    boolean isLabelEnabled()
    Is the label field on the view is enabled
    void setCellValueChangeListener(CellValueChangeListener<CharSequence> listener)
    Subscribe to the changes of the cell value.
    void setClickable(boolean clickable)
    Enable or disable clickable property on the view and all its children
    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)
    Enable or disable the view
    void setError(CharSequence error)
    Set the error text if view is error enabled
    void setErrorEnabled(boolean errorEnabled)
    Enable error text on view
    void setErrorTextAppearance(int resId)
    Set the error text appearance on the view
    void setFocusable(boolean focusable)
    Enable or disable focusable property on the view and all its children
    void setHelperEnabled(boolean enabled)
    Enable helper text on the view
    void setHelperText(CharSequence helperText)
    Set the helper text on the view.
    void setHelperTextAppearance(int textAppearance)
    Set the appearance on the helper text
    void setHint(String hint)
    Set the hint on the SimplePropertyForm cell
    void setHint(int id)
    Set the hint on the SimplePropertyFormCell from String resource
    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 keyName)
    Set the key property of the cell
    void setKeyTextAppearance(int resId)
    Set the text appearance of the Key of the cell.
    void setKeyTextAppearanceFocused(int resId)
    Set the text appearance of the Key of the cell when focused
    void setKeyTextAppearanceUnFocused(int resId)
    Set the text appearance of the Key of the cell when not focused
    void setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
    Set the label text appearance when the view is not focused
    void setMaxLines(int maxLines)
    Set maximum number of lines
    void setMinLines(int minLines)
    Set minimum number of lines on the value
    void setOverrideKeyStyle(boolean overrideKeyStyle)
    Override the Key styling manually.
    void setOverrideStatusStyle(boolean overrideStatusStyle)
    Override the status i.e.
    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 setShouldAttachOrientationListener(boolean shouldAttach)
    Determines if an OrientationEventListener should be attached.
    void setSingleLine(boolean isSingleLine)
    Enable single line only
    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 setValueInputType(int type)
    Set input type on the cell value
    void setValueOnTouchListener(View.OnTouchListener listener)
    Set the touch listener on value field.
    void setValueTextAppearance(int resId)
    Set the text appearance of the value field using given resource.
    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 onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    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 labelEnabled)
    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.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

    SimplePropertyFormCell_android_ellipsize

    Related Methods

    SimplePropertyFormCell_android_enabled

    Related Methods

    SimplePropertyFormCell_android_hint

    Related Methods

    SimplePropertyFormCell_android_inputType

    Related Methods

    SimplePropertyFormCell_android_maxLines

    Related Methods

    SimplePropertyFormCell_android_singleLine

    Related Methods

    SimplePropertyFormCell_android_textColorHint

    Related Methods

    SimplePropertyFormCell_android_textIsSelectable

    SimplePropertyFormCell_isEditable

    Related Methods

    SimplePropertyFormCell_key

    Related Methods

    SimplePropertyFormCell_keyTextAppearance

    Related Methods

    SimplePropertyFormCell_keyTextAppearanceFocused

    SimplePropertyFormCell_keyTextAppearanceUnFocused

    SimplePropertyFormCell_lines

    Related Methods

    SimplePropertyFormCell_value

    Related Methods

    SimplePropertyFormCell_valueTextAppearance

    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

    protected final AppCompatEditText mValue

    Public Constructors

    public SimplePropertyFormCell (Context context)

    public SimplePropertyFormCell (Context context, AttributeSet attrs)

    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 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. Returns null if view is not error enabled.

    Returns
    • TextView

    public CharSequence getHelperText ()

    Get the helper text

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

    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 setCellValueChangeListener (CellValueChangeListener<CharSequence> listener)

    Subscribe to the changes of the cell value.

    Parameters
    listener value change 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)

    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.

    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)

    Enable or disable the view

    Parameters
    enabled boolean

    public void setError (CharSequence error)

    Set the error text if view is error enabled

    Parameters
    error CharSequence

    public void setErrorEnabled (boolean errorEnabled)

    Enable error text on view

    Parameters
    errorEnabled boolean

    public void setErrorTextAppearance (int resId)

    Set the error text appearance on the view

    Parameters
    resId text appearance error

    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)

    Enable helper text on the view

    Parameters
    enabled boolean

    public void setHelperText (CharSequence helperText)

    Set the helper text on the view. This will take effect only if view is helper text enabled.

    Parameters
    helperText CharSequence

    public void setHelperTextAppearance (int textAppearance)

    Set the appearance on the helper text

    Parameters
    textAppearance resource id

    public void setHint (String hint)

    Set the hint on the SimplePropertyForm cell

    Parameters
    hint String

    public void setHint (int id)

    Set the hint on the SimplePropertyFormCell from String resource

    Parameters
    id int

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

    Set the key property of the cell

    Related XML Attributes
    Parameters
    keyName label of the property
    See Also

    public void setKeyTextAppearance (int resId)

    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
    resId style resource

    public void setKeyTextAppearanceFocused (int resId)

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

    Parameters
    resId style resource

    public void setKeyTextAppearanceUnFocused (int resId)

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

    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 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 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 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 has a default action.

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

    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 setSingleLine (boolean isSingleLine)

    Enable single line only

    Parameters
    isSingleLine boolean

    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 setValueInputType (int type)

    Set input type on the cell value

    Parameters
    type int

    public void setValueOnTouchListener (View.OnTouchListener listener)

    Set the touch listener on value field.

    Parameters
    listener OnTouchListener

    public void setValueTextAppearance (int resId)

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

    Parameters
    resId style resource

    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 onFocusChanged (boolean gainFocus, int direction, Rect previouslyFocusedRect)

    protected void onRestoreInstanceState (Parcelable state)

    protected Parcelable onSaveInstanceState ()

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

    Enable or disable the label field on the view

    Parameters
    labelEnabled boolean

    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