java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.LinearLayout | |||
↳ | com.sap.cloud.mobile.fiori.formcell.SimplePropertyFormCell |
![]() |
SimplePropertyFormCell is a simple form cell with a key and editable, single line value field.
Structure of the control :
setKey(CharSequence)
CharSequence
See also: setValue(CharSequence)
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | SimplePropertyFormCell.SecondaryActionType |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected final TextInputLayout | mSimplePropertyCellTextInputLayout | ||||||||||
protected final TextInputEditText | mSimplePropertyTextInputEditText |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Get the subscribed CellValueChangeListener on the cell.
Get the helper text from the view
Get the key view. This API should only be used for testing. You should not create production code using this API.
Returns the prefix text that was set to be displayed with setPrefixText(CharSequence)
,
or null
if there is no prefix text.
Returns the suffix text that was set to be displayed with setSuffixText(CharSequence)
,
or null
if there is no suffix text.
Get the value property of the cell
Get the value view. This API should only be used for testing. You should not create production code using this API.
Get if the cell is editable.
Is error enabled on the view
Returns whether the helper text functionality is enabled or not.
Returns whether the helper text functionality is enabled or not.
Returns whether this cell has been set as a required field.
Returns whether the password visibility toggle functionality is currently enabled.
Set the box's stroke color
color | ColorStateList |
---|
Set the box's stroke color when focused
color | color resource |
---|
Set the box's stroke color when in error state
color | color resource |
---|
Set the box's stroke color when in error state
color | ColorStateList |
---|
Subscribe to the changes of the cell value.
listener | value change listener |
---|
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
contentDescription | the content description to be set |
---|
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
contentDescription | the content description to be set |
---|
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
isEditable | boolean |
---|
Set the ellipsize location when the cell can not accommodate all of the cell value.
Set the enabled state of this cell.
enabled | True if this cell is enabled, false otherwise. |
---|
Set the error text if view is error enabled
error | CharSequence |
---|
Enable or disable the error field on the view
enabled | boolean |
---|
Set the error text appearance on the view
errorTextAppearance | text appearance error |
---|
Set text color of the error text
color | color resource |
---|
Set text color of the error text
color | ColorStateList |
---|
Enable or disable the helper field on the view
enabled | boolean |
---|
Set the helper text on the view
helperText | CharSequence |
---|
Set the helper text appearance
helperTextAppearance | style resource |
---|
Set text color of the helper text
color | color resource |
---|
Set text color of the helper text
color | ColorStateList |
---|
Set the hint on the SimplePropertyForm cell
hint | String |
---|
Set the color of the hint text
color | ColorStateList |
---|
Set the color of the hint text
color | color resource |
---|
Set the ime options on the SimplePropertyFormCell
imeOptions | ime options |
---|
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.
type | int |
---|
Set the key property of the cell
key | label of the property |
---|
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.
keyTextAppearance | style resource |
---|
Set the text appearance of the Key of the cell when focused
keyTextAppearanceFocused | style resource |
---|
Set the text appearance of the Key of the cell when not focused
keyTextAppearanceUnFocused | style resource |
---|
Set the color of the key when in error state
color | ColorStateList |
---|
Set the color of the key when in error state
color | color resource |
---|
Set the color of key when the view is focused
color | ColorStateList |
---|
Set the color of key when the view is focused
color | color resource |
---|
Set the color of key when the view is not focused
color | color resource |
---|
Set the color of key when the view is not focused
color | ColorStateList |
---|
Sets the height of the input text view to be exactly lines
tall.
lines | the exact height of the TextView in terms of lines |
---|
Set maximum number of lines
maxLines | int |
---|
Set minimum number of lines on the value
minLines | int |
---|
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.
prefixText | Prefix text to display |
---|
Set the color of the prefix text
color | colorStateList |
---|
Sets this cell as a required field.
When enabled, an "*" is appended to the key to indicate that the cell is a required field.
requiredField | true to enable the functionality |
---|
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.
drawable | Drawable to set, may be null to clear the icon |
---|
Set a content description for the secondary action icon.
contentDescription | Content description to set |
---|
Applies a tint to the secondary action icon drawable.
endIconTintList | the tint to apply, may be null to clear tint |
---|
Override the default action for the secondary action button.
clickListener | that overridden action to take when the secondary action button is clicked. |
---|
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.
secondaryActionType | the type to set for the secondary action button. |
---|
Enable single line only
isSingleLine | boolean |
---|
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.
suffixText | Suffix text to display |
---|
Set the color of the suffix text
color | colorStateList |
---|
Make the value field of the text selectable or un-selectable
isSelectable | boolean |
---|
Set the value property of the cell
value | value as CharSequence |
---|
Set the on focus change listener on value field.
listener | OnFocusChangeListener |
---|
Set the touch listener on value field.
listener | OnTouchListener |
---|
Set the text appearance of the value field using given resource.
valueTextAppearance | style resource |
---|
Set the text color of the value field
color | ColorStateList |
---|
Set the text color of the value field
color | color resource |
---|
Set the typeface for the value field
style | style resource |
---|