java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.LinearLayout | |||
↳ | com.sap.cloud.mobile.fiori.formcell.DateTimePickerFormCell |
DateTimePickerFormCell FormCell is a control which contains a Key and Value along with a Date/Time picker Dialog. The user can click the key value view to display a popup dialog having Date/Time Picker Dialog.
DateTimePickerFormCell can be used to pick a date, pick a time or to pick both. Using
DateTimePicker.DateTimePickerMode
the cell allows you to control what kind of value (date) an end user can pick. Developer can choose the mode for the cell
setDateTimePickerMode(DateTimePicker.DateTimePickerMode)
using setDateTimePickerMode(DateTimePicker.DateTimePickerMode)
. The default mode is DATE_TIME_PICKER. By default, the user's locale date and time
format will be used to show the date and time value. Developer can specify their own DateFormat by setting setDateTimeFormatter(DateFormat)
.
Structure of the control :
setKey(CharSequence)
Date
See also: setValue(Date)
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DateTimePickerFormCell(Context context) | |||||||||||
DateTimePickerFormCell(Context context, AttributeSet attrs) | |||||||||||
DateTimePickerFormCell(Context context, AttributeSet attrs, int defStyleAttr) | |||||||||||
DateTimePickerFormCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addView(View child, int index, ViewGroup.LayoutParams params)
Add given view in the view
| ||||||||||
int |
getCellType()
Get the cell widget type from
FormCell.WidgetType
| ||||||||||
CellValueChangeListener<Date> |
getCellValueChangeListener()
Get the CellChangeListener of the cell
| ||||||||||
DateFormat |
getDateTimeFormatter()
Get the date time formatter used to format the cell value into informative message
| ||||||||||
DateTimePicker.DateTimePickerMode |
getDateTimePickerMode()
Return the mode of the DateTimePicker.
| ||||||||||
CharSequence |
getDisplayValue()
Get the display value of the cell.
| ||||||||||
CharSequence |
getError()
Get error set on the view
| ||||||||||
TextView | getErrorView() | ||||||||||
CharSequence |
getKey()
Get the key property of the cell
| ||||||||||
TextView | getKeyView() | ||||||||||
Pair<Date, Date> |
getRange()
Get the date range of the cell.
| ||||||||||
Date |
getValue()
Get the value of the Cell.
| ||||||||||
TextView | getValueView() | ||||||||||
boolean |
isEditable()
Get is 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
| ||||||||||
boolean | onInterceptTouchEvent(MotionEvent ev) | ||||||||||
boolean | performClick() | ||||||||||
void |
setCellValueChangeListener(CellValueChangeListener<Date> listener)
Set the listener on the cell
| ||||||||||
void |
setClickable(boolean clickable)
Enable or disable clickable property on the view and all its children
| ||||||||||
void | setDatePickerTitle(CharSequence title) | ||||||||||
void |
setDateTimeFormatter(DateFormat dateTimeFormatter)
Set the date time formatter used to format the cell value into informative message
| ||||||||||
void |
setDateTimePickerMode(DateTimePicker.DateTimePickerMode dateTimePickerMode)
Sets the mode for DateTimePicker
| ||||||||||
void |
setDisplayValue(Date value1, Date value2)
Set display value from the given start and end date.
| ||||||||||
void |
setDisplayValue(CharSequence displayValue)
Set the display value.
| ||||||||||
void |
setDisplayValue(Date value)
Set display value from the given date.
| ||||||||||
void |
setEditable(boolean isEditable)
Enable or disable the cell's editable property
| ||||||||||
void |
setEnabled(boolean enabled)
Enable or disable the view
| ||||||||||
void |
setError(CharSequence error)
Set the error on view
| ||||||||||
void |
setErrorEnabled(boolean errorEnabled)
Enable or disable error enabled
| ||||||||||
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)
Enable or disable helper field on the view
| ||||||||||
void |
setKey(CharSequence key)
Set the key on the cell
| ||||||||||
void |
setKeyEnabled(boolean keyEnabled)
Enable or disable the key field
| ||||||||||
void |
setKeyTextAppearance(int resId)
Set the key Text appearance
| ||||||||||
void |
setKeyTextColor(ColorStateList colorStateList)
Set the color of the value
| ||||||||||
void |
setLabelTextAppearanceUnFocused(int labelTextAppearanceUnFocused)
Set the label text appearance when the view is not focused
| ||||||||||
void | setManager(FragmentManager manager) | ||||||||||
void |
setMaxLines(int lines)
Set max lines on value
| ||||||||||
void |
setMinLines(int minLines)
Set minimum number of lines on display value
| ||||||||||
void |
setOverrideKeyStyle(boolean overrideKeyStyle)
Override the Key styling manually.
| ||||||||||
void |
setOverrideStatusStyle(boolean overrideStatusStyle)
Override the status i.e.
| ||||||||||
void |
setRange(Date value1, Date value2)
Set the date range on the cell
| ||||||||||
void |
setShouldAttachOrientationListener(boolean shouldAttach)
Determines if an OrientationEventListener should be attached.
| ||||||||||
void | setTimePickerTitle(CharSequence title) | ||||||||||
void |
setUseTextDate(boolean useText)
Set whether the date picker should start in text input mode.
| ||||||||||
void |
setUseTextTime(boolean useText)
Set whether the time picker should start in text input mode.
| ||||||||||
void |
setValue(Date value)
Set the value on the cell
| ||||||||||
void |
setValueTextAppearance(int resId)
Set the text appearance of the value property
| ||||||||||
void |
setValueTextColor(ColorStateList color)
Set the color of the value
| ||||||||||
void |
setValueTextColor(int resId)
Set the color of the value
|
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 |
getHelperText()
Get the helper text from the view
| ||||||||||
CharSequence |
getLabel()
Get the label on the view
| ||||||||||
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 |
setHelperText(CharSequence helper)
Set the helper text on the view
| ||||||||||
void |
setHelperTextAppearance(int helperTextAppearance)
Set the helper text appearance
| ||||||||||
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Add given view in the view
child | View |
---|---|
index | position at which the view has to be added |
params | ViewGroup.LayoutParams |
Get the cell widget type from FormCell.WidgetType
Get the CellChangeListener of the cell
Get the date time formatter used to format the cell value into informative message
Return the mode of the DateTimePicker.
Get the display value of the cell.
Get the key property of the cell
Get is the cell is editable.
Is error enabled on the view
Set if the helper field is enabled on the view
Is the label field on the view is enabled
Set the listener on the cell
listener | value change listener of the control |
---|
Enable or disable clickable property on the view and all its children
clickable | boolean |
---|
Set the date time formatter used to format the cell value into informative message
dateTimeFormatter | DateFormat |
---|
Sets the mode for DateTimePicker
dateTimePickerMode | DateTimePickerMode |
---|
Set display value from the given start and end date.
value1 | Start Date |
---|---|
value2 | End Date |
Enable or disable the cell's editable property
isEditable | boolean |
---|
Enable or disable the view
enabled | boolean |
---|
Enable or disable focusable property on the view and all its children
focusable | boolean |
---|
Enable or disable helper field on the view
enabled | boolean |
---|
Set the key on the cell
key | key of the cell as CharSequence |
---|
Enable or disable the key field
keyEnabled | boolean |
---|
Set the key Text appearance
resId | int |
---|
Set the color of the value
colorStateList | ColorStateList |
---|
Set the label text appearance when the view is not focused
labelTextAppearanceUnFocused | Style resource |
---|
Set max lines on value
lines | int |
---|
Set minimum number of lines on display value
minLines | int |
---|
Override the Key styling manually.
overrideKeyStyle | boolean |
---|
Override the status i.e. error and helper styling manually
overrideStatusStyle | boolean |
---|
Determines if an OrientationEventListener should be attached.
shouldAttach | Whether the FormCell should consider attaching an OrientationEventListener or not |
---|
Set whether the date picker should start in text input mode.
useText | boolean |
---|
Set whether the time picker should start in text input mode.
useText | boolean |
---|
Set the text appearance of the value property
resId | int |
---|
Set the color of the value
color | ColorStateList |
---|
Set the color of the value
resId | Color resource as int |
---|
Calculate and set the margins for the cell's elements. Subclasses should override this method to suit their own needs.
Check if the array contains the given property
array | array of integer |
---|---|
value | int |
Drawable state changed
Get the helper text from the view
Get the label on the view
Each time you add a new view, error/helper view has to be adjusted to be the last view in the layout
Set the helper text on the view
helper | CharSequence |
---|
Set the helper text appearance
helperTextAppearance | style resource |
---|
Set the label on the view
key | CharSequence |
---|
Enable or disable the label field on the view
keyEnabled | boolean |
---|
Set the text appearance on the label. This changes the appearance when the view is focused and unfocused
textAppearance | style resource |
---|
Set the text appearance on the label when the view is not focused
textAppearance | Style resource |
---|
Set the text color of the label for error mode
color | ColorStateList |
---|
Set the color of label when the view is focused
color | ColorStateList |
---|
Set the color of label when the view is not focused
color | ColorStateList |
---|
Setup the error/helper field on the view
Setup the label view on the view
Should layout the given view
v | View |
---|