public class

DateTimePickerFormCell

extends FormCellMetadataLayout
implements FormCell<T> InlineValidation SupportsKey
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
           ↳ com.sap.cloud.mobile.fiori.formcell.DateTimePickerFormCell

Class Overview

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 :

  • 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 Date See also: setValue(Date)
  • Summary

    XML Attributes
    Attribute Name Related Method Description
    DateTimePickerFormCell_android_maxLines  
    DateTimePickerFormCell_android_textColor  
    DateTimePickerFormCell_dateTimeFormatter setDateTimeFormatter(DateFormat)  
    DateTimePickerFormCell_dateTimePickerMode  
    DateTimePickerFormCell_isEditable setEditable(boolean)  
    DateTimePickerFormCell_key setKeyEnabled(boolean)  
    DateTimePickerFormCell_keyEnabled  
    DateTimePickerFormCell_keyTextAppearance setKeyTextAppearance(int)  
    DateTimePickerFormCell_valueTextAppearance setValueTextColor(int)  
    [Expand]
    Inherited XML Attributes
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    [Expand]
    Inherited Constants
    From class android.widget.LinearLayout
    From class android.view.ViewGroup
    From class android.view.View
    [Expand]
    Inherited Fields
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    From class android.view.View
    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
    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<DateDate> 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 onInterceptTouchEvent(MotionEvent ev)
    boolean performClick()
    void setCellValueChangeListener(CellValueChangeListener<Date> listener)
    Set the listener on the cell
    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 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 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 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 setRange(Date value1, Date value2)
    Set the date range on the cell
    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.
    void onRestoreInstanceState(Parcelable state)
    Parcelable onSaveInstanceState()
    [Expand]
    Inherited Methods
    From class com.sap.cloud.mobile.fiori.formcell.FormCellMetadataLayout
    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.SupportsKey

    XML Attributes

    DateTimePickerFormCell_android_maxLines

    Related Methods

    DateTimePickerFormCell_android_textColor

    Related Methods

    DateTimePickerFormCell_dateTimeFormatter

    DateTimePickerFormCell_dateTimePickerMode

    Related Methods

    DateTimePickerFormCell_isEditable

    Related Methods

    DateTimePickerFormCell_key

    Related Methods

    DateTimePickerFormCell_keyEnabled

    Related Methods

    DateTimePickerFormCell_keyTextAppearance

    Related Methods

    DateTimePickerFormCell_valueTextAppearance

    Related Methods

    Public Constructors

    public DateTimePickerFormCell (Context context)

    public DateTimePickerFormCell (Context context, AttributeSet attrs)

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

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

    Public Methods

    public int getCellType ()

    Get the cell widget type from FormCell.WidgetType

    Returns
    • WidgetType type of the control

    public CellValueChangeListener<Date> getCellValueChangeListener ()

    Get the CellChangeListener of the cell

    Returns
    • CellValueChangeListener

    public DateFormat getDateTimeFormatter ()

    Get the date time formatter used to format the cell value into informative message

    Returns
    • DateFormat

    public DateTimePicker.DateTimePickerMode getDateTimePickerMode ()

    Return the mode of the DateTimePicker.

    Returns
    • DateTimePickerMode mode of DateTimePicker

    public CharSequence getDisplayValue ()

    Get the display value of the cell.

    Returns
    • display value as CharSequence

    public CharSequence getError ()

    Get error set on the view

    Returns
    • error as CharSequence

    public TextView getErrorView ()

    public CharSequence getKey ()

    Get the key property of the cell

    Related XML Attributes
    Returns
    • key of the cell as CharSequence

    public TextView getKeyView ()

    public Pair<DateDate> getRange ()

    Get the date range of the cell.

    Returns
    • Pair

    public Date getValue ()

    Get the value of the Cell.

    Returns
    • Date
    See Also

    public TextView getValueView ()

    public boolean isEditable ()

    Get is the cell is editable.

    Related XML Attributes
    Returns
    • boolean

    public boolean onInterceptTouchEvent (MotionEvent ev)

    public boolean performClick ()

    public void setCellValueChangeListener (CellValueChangeListener<Date> listener)

    Set the listener on the cell

    Parameters
    listener value change listener of the control

    public void setDatePickerTitle (CharSequence title)

    public void setDateTimeFormatter (DateFormat dateTimeFormatter)

    Set the date time formatter used to format the cell value into informative message

    Parameters
    dateTimeFormatter DateFormat

    public void setDateTimePickerMode (DateTimePicker.DateTimePickerMode dateTimePickerMode)

    Sets the mode for DateTimePicker

    Parameters
    dateTimePickerMode DateTimePickerMode

    public void setDisplayValue (Date value1, Date value2)

    Set display value from the given start and end date.

    Parameters
    value1 Start Date
    value2 End Date

    public void setDisplayValue (CharSequence displayValue)

    Set the display value.

    Parameters
    displayValue CharSequence

    public void setDisplayValue (Date value)

    Set display value from the given date.

    Parameters
    value Date

    public void setEditable (boolean isEditable)

    Enable or disable the cell's editable property

    Related XML Attributes
    Parameters
    isEditable boolean
    See Also

    public void setError (CharSequence error)

    Set the error on view

    Parameters
    error CharSequence

    public void setErrorEnabled (boolean errorEnabled)

    Enable or disable error enabled

    Parameters
    errorEnabled boolean

    public void setErrorTextAppearance (int resId)

    Set the error text appearance

    Parameters
    resId Style Res

    public void setHelperEnabled (boolean enabled)

    Enable or disable helper field on the view

    Parameters
    enabled boolean

    public void setKey (CharSequence key)

    Set the key on the cell

    Related XML Attributes
    Parameters
    key key of the cell as CharSequence
    See Also

    public void setKeyEnabled (boolean keyEnabled)

    Enable or disable the key field

    Related XML Attributes
    Parameters
    keyEnabled boolean

    public void setKeyTextAppearance (int resId)

    Set the key Text appearance

    Parameters
    resId int

    public void setKeyTextColor (ColorStateList colorStateList)

    Set the color of the value

    Parameters
    colorStateList ColorStateList

    public void setManager (FragmentManager manager)

    public void setMaxLines (int lines)

    Set max lines on value

    Parameters
    lines int

    public void setMinLines (int minLines)

    Set minimum number of lines on display value

    Parameters
    minLines int

    public void setRange (Date value1, Date value2)

    Set the date range on the cell

    Parameters
    value1 Begin Date
    value2 End Date
    See Also

    public void setTimePickerTitle (CharSequence title)

    public void setUseTextDate (boolean useText)

    Set whether the date picker should start in text input mode.

    Parameters
    useText boolean

    public void setUseTextTime (boolean useText)

    Set whether the time picker should start in text input mode.

    Parameters
    useText boolean

    public void setValue (Date value)

    Set the value on the cell

    Parameters
    value value of the property
    See Also

    public void setValueTextAppearance (int resId)

    Set the text appearance of the value property

    Parameters
    resId int

    public void setValueTextColor (ColorStateList color)

    Set the color of the value

    Parameters
    color ColorStateList

    public void setValueTextColor (int resId)

    Set the color of the value

    Parameters
    resId Color resource as int

    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 void onRestoreInstanceState (Parcelable state)

    protected Parcelable onSaveInstanceState ()