Package eltos.simpledialogfragment.form
Class DateTime
java.lang.Object
eltos.simpledialogfragment.form.FormElement<DateTime,eltos.simpledialogfragment.form.DateTimeViewHolder>
eltos.simpledialogfragment.form.DateTime
- All Implemented Interfaces:
android.os.Parcelable
public class DateTime
extends FormElement<DateTime,eltos.simpledialogfragment.form.DateTimeViewHolder>
A color element to be used with
SimpleFormDialog
One can pick a date, time or both here
This will add a long to resource bundle containing the timestamp.
Created by eltos on 13.02.19-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final android.os.Parcelable.Creator<DateTime>
protected Long
protected Integer
protected Long
protected Long
protected Integer
protected DateTime.Type
Fields inherited from class eltos.simpledialogfragment.form.FormElement
NO_ID, required, resultKey
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioneltos.simpledialogfragment.form.DateTimeViewHolder
Return your custom implementation ofFormElementViewHolder
herestatic DateTime
Factory method for a date field.Sets the initial date and timestatic DateTime
Factory method for a datetime field.int
Sets the last date selectableSets the first date selectablestatic DateTime
Factory method for a date/time/datetime field.time
(int hour, int minute) Sets the initial timestatic DateTime
Factory method for a time field.type
(DateTime.Type type) Sets this fields typevoid
writeToParcel
(android.os.Parcel dest, int flags)
-
Field Details
-
type
-
min
-
max
-
date
-
hour
-
minute
-
CREATOR
-
-
Constructor Details
-
DateTime
protected DateTime(android.os.Parcel in)
-
-
Method Details
-
picker
Factory method for a date/time/datetime field.- Parameters:
key
- the key that can be used to receive the final state from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Returns:
- this instance
-
date
Factory method for a date field.- Parameters:
key
- the key that can be used to receive the final state from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Returns:
- this instance
-
time
Factory method for a time field.- Parameters:
key
- the key that can be used to receive the final state from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Returns:
- this instance
-
datetime
Factory method for a datetime field.- Parameters:
key
- the key that can be used to receive the final state from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Returns:
- this instance
-
type
Sets this fields type- Parameters:
type
- type of field:DateTime.Type.DATE
,DateTime.Type.TIME
orDateTime.Type.DATETIME
- Returns:
- this instance
-
min
Sets the first date selectable- Parameters:
date
- minimal date- Returns:
- this instance
-
max
Sets the last date selectable- Parameters:
date
- maximal date- Returns:
- this instance
-
date
Sets the initial date and time- Parameters:
date
- initial date- Returns:
- this instance
-
time
Sets the initial time- Parameters:
hour
- initial hourminute
- initial minute- Returns:
- this instance
-
buildViewHolder
public eltos.simpledialogfragment.form.DateTimeViewHolder buildViewHolder()Description copied from class:FormElement
Return your custom implementation ofFormElementViewHolder
here- Specified by:
buildViewHolder
in classFormElement<DateTime,
eltos.simpledialogfragment.form.DateTimeViewHolder> - Returns:
- The view holder that can represent this form element
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Overrides:
writeToParcel
in classFormElement<DateTime,
eltos.simpledialogfragment.form.DateTimeViewHolder>
-
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Overrides:
describeContents
in classFormElement<DateTime,
eltos.simpledialogfragment.form.DateTimeViewHolder>
-