public class

DatePicker

extends WheelContainer
implements PickerInterfaces.Views.DatePickerInterface
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.droidux.pack.wheel.widget.WheelContainer
           ↳ com.droidux.pack.wheel.widget.DatePicker

Class Overview

A view that allows users to pick a date using a set of wheel widgets.

Summary

XML Attributes
Attribute Name Related Method Description
dux_casingDrawable Reference to a drawable resource to use as casing/cover for a wheel container. 
dux_color_dayWheel setDayWheelColor(int) Color of the DoyOfMonth wheel in a com.droidux.widget.wheel.DatePicker widget. 
dux_color_monthWheel setMonthWheelColor(int) Color of the month wheel in a com.droidux.widget.wheel.DatePicker widget. 
dux_color_yearWheel setYearWheelColor(int) Color of the year wheel in a com.droidux.widget.wheel.DatePicker widget. 
dux_dateFormat The date format to use when using com.droidux.widget.wheel.DatePicker. 
dux_drawSelectorOnTop When set to true, the selector will be drawn over the selected item. 
dux_embossEffect When set to true and the items of a wheel widget is represented by a TextView, an emboss effect will be applied to the text widget. 
dux_faceColor Specifies the face color of a wheel. 
dux_frameColor Specifies the frame color of a wheel. 
dux_leftStaticView A reference to a layout resource containing view to be displayed on the left of the selected item in a wheel widget. 
dux_leftStaticView A reference to a layout resource containing view to be displayed on the right of the selected item in a wheel widget. 
dux_selectorDrawable Reference to a drawable resource to use for a selector. 
dux_selectorDrawable_tint Specifies a color to overlay/tint the selector drawable. 
dux_textAppearance The style/appearance of text widget use to represent wheel items. 
dux_textAppearance_today The style/appearance of text widget use to represent Today's date in a com.droidux.widget.wheel.DateTimePicker widget. 
dux_visibleItems Specifies the number of visible items in a wheel widget. 
[Expand]
Inherited XML Attributes
From class com.droidux.pack.wheel.widget.WheelContainer
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
DatePicker(Context context)
DatePicker(Context context, AttributeSet attrs)
Public Methods
int getDayOfMonth()
Gets the selected day of month.
int getDayWheelColor()
Gets the face color of the day wheel.
View getLeftStaticView()
Gets the static view to be displayed on the left of the selected value, if any.
int getMonth()
Gets the selected month.
int getMonthWheelColor()
Gets the face color of the month wheel.
PickerInterfaces.Listeners.OnDateChangedListener getOnDateChangedListener()
Gets the date change listener registered for this view.
View getRightStaticView()
Gets the static view to be displayed on the right of the selected value, if any.
int getYear()
Gets the selected year.
int getYearWheelColor()
Gets the face color of the year wheel.
void setCallbackDuringFling(boolean shouldCallback)
Whether or not to callback on any -changed listener while the items are being flinged.
void setDayWheelColor(int color)
Sets the face color of the day wheel.
void setLeftStaticView(View view)
Sets a static view to be displayed on the left of the selected value.
void setMonthWheelColor(int color)
Sets the face color of the month wheel.
void setOnDateChangedListener(PickerInterfaces.Listeners.OnDateChangedListener listener)
Register a listener to be notified when the date is changed.
void setRightStaticView(View view)
Sets a static view to be displayed on the right of the selected value.
void setYearWheelColor(int color)
Sets the face color of the year wheel.
void updateDate(int year, int month, int day)
Updates the date to the specified values.
Protected Methods
void onDetachedFromWindow()
This is called when the view is detached from a window.
void onRestoreInstanceState(Parcelable state)
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState().
Parcelable onSaveInstanceState()
Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.
[Expand]
Inherited Methods
From class com.droidux.pack.wheel.widget.WheelContainer
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.droidux.pack.wheel.interfaces.PickerInterfaces.Views.DatePickerInterface
From interface com.droidux.pack.wheel.interfaces.WheelInterfaces.Views.WheelContainerInterface

XML Attributes

dux_casingDrawable

Since: API Level

Reference to a drawable resource to use as casing/cover for a wheel container.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

Related Methods

dux_color_dayWheel

Since: API Level

Color of the DoyOfMonth wheel in a com.droidux.widget.wheel.DatePicker widget.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_color_monthWheel

Since: API Level

Color of the month wheel in a com.droidux.widget.wheel.DatePicker widget.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_color_yearWheel

Since: API Level

Color of the year wheel in a com.droidux.widget.wheel.DatePicker widget.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_dateFormat

Since: API Level

The date format to use when using com.droidux.widget.wheel.DatePicker.

Must be one of the following constant values.

ConstantValueDescription
dmy0 The wheels will be displayed in the order of: Day-Month-Year
mdy1 The wheels will be displayed in the order of: Month-Day-Year
ymd2 The wheels will be displayed in the order of: Year-Month-Day

Related Methods

dux_drawSelectorOnTop

Since: API Level

When set to true, the selector will be drawn over the selected item. Otherwise the selector is drawn behind the selected item. The default value is true.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

dux_embossEffect

Since: API Level

When set to true and the items of a wheel widget is represented by a TextView, an emboss effect will be applied to the text widget. Default value is true.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

dux_faceColor

Since: API Level

Specifies the face color of a wheel.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_frameColor

Since: API Level

Specifies the frame color of a wheel.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_leftStaticView

Since: API Level

A reference to a layout resource containing view to be displayed on the left of the selected item in a wheel widget. Can be used to show a static label, icon, button, or other appropriate views.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

Related Methods

dux_leftStaticView

Since: API Level

A reference to a layout resource containing view to be displayed on the right of the selected item in a wheel widget. Can be used to show a static label, icon, button, or other appropriate views.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

Related Methods

dux_selectorDrawable

Since: API Level

Reference to a drawable resource to use for a selector.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

Related Methods

dux_selectorDrawable_tint

Since: API Level

Specifies a color to overlay/tint the selector drawable.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_textAppearance

Since: API Level

The style/appearance of text widget use to represent wheel items. The text appearance defines the ase text color, typeface, size, and style.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This corresponds to the global attribute resource symbol textAppearance.

Related Methods

dux_textAppearance_today

Since: API Level

The style/appearance of text widget use to represent Today's date in a com.droidux.widget.wheel.DateTimePicker widget. The text appearance defines the ase text color, typeface, size, and style.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This corresponds to the global attribute resource symbol textAppearance.

Related Methods

dux_visibleItems

Since: API Level

Specifies the number of visible items in a wheel widget. Default is 5.

Must be an integer value, such as "5".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

Public Constructors

public DatePicker (Context context)

Since: API Level 2.5

public DatePicker (Context context, AttributeSet attrs)

Since: API Level 2.5

Public Methods

public int getDayOfMonth ()

Since: API Level 2.5

Gets the selected day of month.

Returns
  • The selected day of month.

public int getDayWheelColor ()

Since: API Level 2.5

Gets the face color of the day wheel.

Related XML Attributes
Returns
  • The day color.

public View getLeftStaticView ()

Since: API Level 2.5

Gets the static view to be displayed on the left of the selected value, if any.

Returns
  • The left static view, or null.

public int getMonth ()

Since: API Level 2.5

Gets the selected month.

Returns
  • The selected month.

public int getMonthWheelColor ()

Since: API Level 2.5

Gets the face color of the month wheel.

Related XML Attributes
Returns
  • The month color.

public PickerInterfaces.Listeners.OnDateChangedListener getOnDateChangedListener ()

Since: API Level 2.5

Gets the date change listener registered for this view.

Returns
  • The listener.

public View getRightStaticView ()

Since: API Level 2.5

Gets the static view to be displayed on the right of the selected value, if any.

Returns
  • The right static view, or null.

public int getYear ()

Since: API Level 2.5

Gets the selected year.

Returns
  • The selected year.

public int getYearWheelColor ()

Since: API Level 2.5

Gets the face color of the year wheel.

Related XML Attributes
Returns
  • The year color.

public void setCallbackDuringFling (boolean shouldCallback)

Since: API Level 2.5

Whether or not to callback on any -changed listener while the items are being flinged. If false only the final selected item will cause the callback. If true, all items between the first and the final will cause callbacks.

Parameters
shouldCallback Whether or not to callback on the listener while the items are being flinged.

public void setDayWheelColor (int color)

Since: API Level 2.5

Sets the face color of the day wheel.

Related XML Attributes
Parameters
color The day color.

public void setLeftStaticView (View view)

Since: API Level 2.5

Sets a static view to be displayed on the left of the selected value. The static view can be used, for example, to display label, reset button, etc.

Parameters
view The view to be displayed on the left of the selected value. Or null.

public void setMonthWheelColor (int color)

Since: API Level 2.5

Sets the face color of the month wheel.

Related XML Attributes
Parameters
color The month color.

public void setOnDateChangedListener (PickerInterfaces.Listeners.OnDateChangedListener listener)

Since: API Level 2.5

Register a listener to be notified when the date is changed.

Parameters
listener The listener to be notified.

public void setRightStaticView (View view)

Since: API Level 2.5

Sets a static view to be displayed on the right of the selected value. The static view can be used, for example, to display label, reset button, etc.

Parameters
view The view to be displayed on the right of the selected value. Or null.

public void setYearWheelColor (int color)

Since: API Level 2.5

Sets the face color of the year wheel.

Related XML Attributes
Parameters
color The year color.

public void updateDate (int year, int month, int day)

Since: API Level 2.5

Updates the date to the specified values.

Parameters
year The selected year.
month The selected month.
day The selected day.

Protected Methods

protected void onDetachedFromWindow ()

Since: API Level

This is called when the view is detached from a window. At this point it no longer has a surface for drawing.

protected void onRestoreInstanceState (Parcelable state)

Since: API Level

Hook allowing a view to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState(). This function will never be called with a null state.

Parameters
state The frozen state that had previously been returned by onSaveInstanceState().

protected Parcelable onSaveInstanceState ()

Since: API Level

Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state. This state should only contain information that is not persistent or can not be reconstructed later. For example, you will never store your current position on screen because that will be computed again when a new instance of the view is placed in its view hierarchy.

Some examples of things you may store here: the current cursor position in a text view (but usually not the text itself since that is stored in a content provider or other persistent storage), the currently selected item in a list view.

Returns
  • Returns a Parcelable object containing the view's current dynamic state, or null if there is nothing interesting to save. The default implementation returns null.