public class YearPicker extends ListView
| Modifier and Type | Class and Description |
|---|---|
static interface |
YearPicker.OnYearChangedListener
Interface definition for a callback to be invoked when the selected year is changed.
|
mCurrentStyle, mStyleId| Constructor and Description |
|---|
YearPicker(android.content.Context context) |
YearPicker(android.content.Context context,
android.util.AttributeSet attrs) |
YearPicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
YearPicker(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) |
int |
getYear() |
void |
goTo(int year)
Jump to a specific year.
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
postSetSelectionFromTop(int position,
int offset) |
void |
setOnYearChangedListener(YearPicker.OnYearChangedListener listener)
Set a listener will be called when the selected year value is changed.
|
void |
setYear(int year)
Set the selected year.
|
void |
setYearRange(int min,
int max)
Set the range of selectable year value.
|
applyStyle, onAttachedToWindow, onDetachedFromWindow, onThemeChanged, setRecyclerListenerpublic YearPicker(android.content.Context context)
public YearPicker(android.content.Context context,
android.util.AttributeSet attrs)
public YearPicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public YearPicker(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 setYearRange(int min,
int max)
min - The minimum selectable year value.max - The maximum selectable year value.public void goTo(int year)
year - public void postSetSelectionFromTop(int position,
int offset)
public void setYear(int year)
year - The selected year value.public int getYear()
public void setOnYearChangedListener(YearPicker.OnYearChangedListener listener)
listener - The YearPicker.OnYearChangedListener will be called.protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
public android.os.Parcelable onSaveInstanceState()
public void onRestoreInstanceState(android.os.Parcelable state)