public class

DateTimePicker

extends Object
implements DatePickerDialog.OnDateSetListener TimePickerDialog.OnTimeSetListener
java.lang.Object
   ↳ com.sap.cloud.mobile.fiori.formcell.DateTimePicker

Class Overview

Customized DateTimePicker control which contains TextView and a Date/Time Dialog. The user can click the view to display a popup dialog having Date/Time Picker Dialog. Developer can choose the mode for the control setDateTimePickerMode(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.

Structure of the control :

  • TextView : showing the text to be displayed for label of the control
  • TextView : showing the value string of the control
  • Summary

    Nested Classes
    enum DateTimePicker.DateTimePickerMode DateTimePickerMode controls the kind of value selection dialogs are presented to user. 
    Public Constructors
    DateTimePicker(Context context)
    Construct a new DateTimePicker with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.DATE_TIME_PICKER
    Public Methods
    CellValueChangeListener<Date> getCellValueChangeListener()
    DateTimePicker.DateTimePickerMode getDateTimePickerMode()
    Return the mode of the DateTimePicker.
    Pair<DateDate> getRange()
    Get the last selected date range.
    Date getValue()
    Get the last selected value.
    void onDateSet(DatePicker view, int year, int month, int dayOfMonth)
    void onRangeSet(int year1, int month1, int dayOfMonth1, int year2, int month2, int dayOfMonth2)
    void onTimeSet(TimePicker view, int hourOfDay, int minute)
    void setCellValueChangeListener(CellValueChangeListener<Date> listener)
    Set the FormCell.CellValueChangeListener for listening the changes to value
    void setDateTimePickerMode(DateTimePicker.DateTimePickerMode dateTimePickerMode)
    Sets the mode for DateTimePicker
    void setDateTimeTitle(CharSequence dateTimeTitle)
    void setManager(FragmentManager manager)
    void setRange(Date value1, Date value2)
    Set the date range.
    void setTimeTitle(CharSequence timeTitle)
    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
    void show()
    Show the dialog.
    [Expand]
    Inherited Methods
    From class java.lang.Object
    From interface android.app.DatePickerDialog.OnDateSetListener
    From interface android.app.TimePickerDialog.OnTimeSetListener

    Public Constructors

    public DateTimePicker (Context context)

    Construct a new DateTimePicker with default styling, overriding the attributes for the control as requested, sets the CellType to WidgetType.DATE_TIME_PICKER

    Parameters
    context context

    Public Methods

    public CellValueChangeListener<Date> getCellValueChangeListener ()

    public DateTimePicker.DateTimePickerMode getDateTimePickerMode ()

    Return the mode of the DateTimePicker.

    Returns
    • DateTimePickerMode mode of DateTimePicker

    public Pair<DateDate> getRange ()

    Get the last selected date range.

    Returns
    • Pair

    public Date getValue ()

    Get the last selected value. If no user interaction has taken place then return the current time.

    Returns
    • Date

    public void onDateSet (DatePicker view, int year, int month, int dayOfMonth)

    public void onRangeSet (int year1, int month1, int dayOfMonth1, int year2, int month2, int dayOfMonth2)

    public void onTimeSet (TimePicker view, int hourOfDay, int minute)

    public void setCellValueChangeListener (CellValueChangeListener<Date> listener)

    Set the FormCell.CellValueChangeListener for listening the changes to value

    Parameters
    listener FormCell.CellValueChangeListener

    public void setDateTimePickerMode (DateTimePicker.DateTimePickerMode dateTimePickerMode)

    Sets the mode for DateTimePicker

    Parameters
    dateTimePickerMode DateTimePickerMode

    public void setDateTimeTitle (CharSequence dateTimeTitle)

    public void setManager (FragmentManager manager)

    public void setRange (Date value1, Date value2)

    Set the date range.

    Parameters
    value1 Start Date
    value2 End Date

    public void setTimeTitle (CharSequence timeTitle)

    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

    Parameters
    value Date

    public void show ()

    Show the dialog. If the mode is TIME_PICKER then show the TimePicker dialog else present a DatePicker dialog