public class DatePicker extends ListView implements android.widget.AbsListView.OnScrollListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
DatePicker.OnDateChangedListener
Interface definition for a callback to be invoked when the selected date is changed.
|
| Modifier and Type | Field and Description |
|---|---|
protected static int |
LIST_TOP_OFFSET |
protected int |
mCurrentScrollState |
protected int |
mCurrentStyle |
protected float |
mFriction |
protected android.os.Handler |
mHandler |
protected long |
mPreviousScrollPosition |
protected int |
mPreviousScrollState |
protected com.rey.material.widget.DatePicker.ScrollStateRunnable |
mScrollStateChangedRunnable |
protected int |
mStyleId |
protected static int |
SCROLL_CHANGE_DELAY |
protected static int |
SCROLL_DURATION |
| Constructor and Description |
|---|
DatePicker(android.content.Context context) |
DatePicker(android.content.Context context,
android.util.AttributeSet attrs) |
DatePicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
DatePicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyStyle(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
java.util.Calendar |
getCalendar() |
int |
getDay() |
java.lang.String |
getFormattedDate(java.text.DateFormat formatter)
Get the formatted string of selected date.
|
int |
getMonth() |
int |
getSelectionColor() |
int |
getTextColor() |
int |
getTextDisableColor() |
int |
getTextHighlightColor() |
int |
getTextLabelColor() |
int |
getTextSize() |
android.graphics.Typeface |
getTypeface() |
int |
getYear() |
void |
goTo(int month,
int year)
Jump to the view of a specific month.
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onScroll(android.widget.AbsListView view,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount) |
void |
onScrollStateChanged(android.widget.AbsListView absListView,
int scroll) |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
postSetSelectionFromTop(int position,
int offset) |
void |
setContentPadding(int left,
int top,
int right,
int bottom) |
void |
setDate(int day,
int month,
int year)
Set the selected date of this DatePicker.
|
void |
setDateRange(int minDay,
int minMonth,
int minYear,
int maxDay,
int maxMonth,
int maxYear)
Set the range of selectable dates.
|
void |
setOnDateChangedListener(DatePicker.OnDateChangedListener listener)
Set the listener will be called when the selected date is changed.
|
void |
setPadding(int left,
int top,
int right,
int bottom) |
applyStyle, onAttachedToWindow, onDetachedFromWindow, onThemeChanged, setRecyclerListenerprotected int mStyleId
protected int mCurrentStyle
protected static final int SCROLL_DURATION
protected static final int SCROLL_CHANGE_DELAY
protected static final int LIST_TOP_OFFSET
protected android.os.Handler mHandler
protected int mCurrentScrollState
protected long mPreviousScrollPosition
protected int mPreviousScrollState
protected float mFriction
protected com.rey.material.widget.DatePicker.ScrollStateRunnable mScrollStateChangedRunnable
public DatePicker(android.content.Context context)
public DatePicker(android.content.Context context,
android.util.AttributeSet attrs)
public DatePicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public DatePicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
protected void applyStyle(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
applyStyle in class ListViewpublic void onScroll(android.widget.AbsListView view,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount)
onScroll in interface android.widget.AbsListView.OnScrollListenerpublic void onScrollStateChanged(android.widget.AbsListView absListView,
int scroll)
onScrollStateChanged in interface android.widget.AbsListView.OnScrollListenerprotected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
public void setPadding(int left,
int top,
int right,
int bottom)
public void setContentPadding(int left,
int top,
int right,
int bottom)
public void setDateRange(int minDay,
int minMonth,
int minYear,
int maxDay,
int maxMonth,
int maxYear)
minDay - The day value of minimum date.minMonth - The month value of minimum date.minYear - The year value of minimum date.maxDay - The day value of maximum date.maxMonth - The month value of maximum date.maxYear - The year value of maximum date.public void goTo(int month,
int year)
month - year - public void postSetSelectionFromTop(int position,
int offset)
public void setDate(int day,
int month,
int year)
day - The day value of selected date.month - The month value of selected date.year - The year value of selected date.public void setOnDateChangedListener(DatePicker.OnDateChangedListener listener)
listener - The DatePicker.OnDateChangedListener will be called.public int getDay()
public int getMonth()
public int getYear()
public java.lang.String getFormattedDate(java.text.DateFormat formatter)
formatter - The DateFormat used to format the date.public int getSelectionColor()
public int getTextSize()
public android.graphics.Typeface getTypeface()
public int getTextColor()
public int getTextLabelColor()
public int getTextHighlightColor()
public int getTextDisableColor()
public java.util.Calendar getCalendar()