WIMM Labs


com.wimm.framework.app
Class YearPickerDialog

java.lang.Object
  extended by android.app.Dialog
      extended by com.wimm.framework.app.Dialog
          extended by com.wimm.framework.app.YearPickerDialog
All Implemented Interfaces:
DialogInterface, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback

public class YearPickerDialog
extends Dialog

A Dialog for selecting a year.

Use this class and DatePickerDialog instead of Android's DatePickerDialog.

Since:
WIMM SDK 1.0.0
See Also:
Dialog, DatePickerDialog, TimePickerDialog

Nested Class Summary
static interface YearPickerDialog.OnYearSelectedListener
          Interface supporting a callback function called when the year is selected.
 
Nested classes/interfaces inherited from interface android.content.DialogInterface
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener
 
Field Summary
 
Fields inherited from interface android.content.DialogInterface
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
 
Constructor Summary
YearPickerDialog(Context context)
          Constructor.
YearPickerDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
          Constructor.
 
Method Summary
 void setYear(int year)
          Sets the year to display as initially selected in the dialog.
 void setYearRange(int min, int max)
          Sets the range of selectable years to display in the dialog.
 void setYearSelectedListener(YearPickerDialog.OnYearSelectedListener listener)
          Sets the listener for the onYearSelected event.
 
Methods inherited from class android.app.Dialog
addContentView, cancel, closeOptionsMenu, dismiss, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, isShowing, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YearPickerDialog

public YearPickerDialog(Context context)
Constructor.

Parameters:
context - The Context.
Since:
WIMM SDK 1.0.0

YearPickerDialog

public YearPickerDialog(Context context,
                        boolean cancelable,
                        DialogInterface.OnCancelListener cancelListener)
Constructor.

Parameters:
context - The Context.
cancelable - A flag specifying whether the dialog can be cancelled.
cancelListener - The listener to inform when the dialog's cancel method is called.
Since:
WIMM SDK 1.0.0
Method Detail

setYearSelectedListener

public void setYearSelectedListener(YearPickerDialog.OnYearSelectedListener listener)
Sets the listener for the onYearSelected event.

Parameters:
listener - The listener.
Since:
WIMM SDK 1.0.0

setYear

public void setYear(int year)
Sets the year to display as initially selected in the dialog.

Parameters:
year - The selected year.
Since:
WIMM SDK 1.0.0

setYearRange

public void setYearRange(int min,
                         int max)
Sets the range of selectable years to display in the dialog.

Parameters:
min - The earliest year to display.
max - The latest year to display.
Since:
WIMM SDK 1.0.0

WIMM Labs