public class SlideDateTimePicker
extends java.lang.Object
This class contains methods for the library client to create
a new SlideDateTimePicker.
It also implements a Builder API that offers more convenient object creation.
| Modifier and Type | Class and Description |
|---|---|
static class |
SlideDateTimePicker.Builder |
| Modifier and Type | Field and Description |
|---|---|
static int |
HOLO_DARK |
static int |
HOLO_LIGHT |
| Constructor and Description |
|---|
SlideDateTimePicker(FragmentManager fm)
Creates a new instance of
SlideDateTimePicker. |
| Modifier and Type | Method and Description |
|---|---|
void |
setIndicatorColor(int indicatorColor)
Sets the color of the underline for the currently selected tab.
|
void |
setInitialDate(java.util.Date initialDate)
Sets the initial date and time to display in the date
and time pickers.
|
void |
setIs24HourTime(boolean is24HourTime)
Sets whether the TimePicker displays its time in 12-hour
(AM/PM) or 24-hour format.
|
void |
setListener(SlideDateTimeListener listener)
Sets the listener that is used to inform the client when
the user selects a new date and time.
|
void |
setMaxDate(java.util.Date maxDate)
Sets the maximum date that the DatePicker should show.
|
void |
setMinDate(java.util.Date minDate)
Sets the minimum date that the DatePicker should show.
|
void |
setTheme(int theme)
Sets the theme of the dialog.
|
void |
show()
Shows the dialog to the user.
|
public static final int HOLO_DARK
public static final int HOLO_LIGHT
public SlideDateTimePicker(FragmentManager fm)
SlideDateTimePicker.fm - The FragmentManager from the calling activity that is used
internally to show the DialogFragment.public void setListener(SlideDateTimeListener listener)
Sets the listener that is used to inform the client when the user selects a new date and time.
This must be called before show().
listener - public void setInitialDate(java.util.Date initialDate)
Sets the initial date and time to display in the date and time pickers.
If this method is not called, the current date and time will be displayed.
initialDate - the Date object used to determine the
initial date and time to displaypublic void setMinDate(java.util.Date minDate)
Sets the minimum date that the DatePicker should show.
This must be called before show().
minDate - the minimum selectable date for the DatePickerpublic void setMaxDate(java.util.Date maxDate)
Sets the maximum date that the DatePicker should show.
This must be called before show().
maxDate - the maximum selectable date for the DatePickerpublic void setIs24HourTime(boolean is24HourTime)
Sets whether the TimePicker displays its time in 12-hour (AM/PM) or 24-hour format.
If this method is not called, the device's default time format is used.
This also affects the time displayed in the tab.
Must be called before show().
is24HourTime - true to force 24-hour time format,
false to force 12-hour (AM/PM) time
format.public void setTheme(int theme)
theme - SlideDateTimePicker.HOLO_DARK for a dark theme, or
SlideDateTimePicker.HOLO_LIGHT for a light themepublic void setIndicatorColor(int indicatorColor)
indicatorColor - the color of the selected tab's underlinepublic void show()
#setListener() before calling this.