public class

DateTimePicker

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

Class Overview

A view that allows users to pick a date and time 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_ampmWheel setAmPmWheelColor(int) Color of the AmPm wheel in a com.droidux.widget.wheel.DateTimePicker widget. 
dux_color_dateWheel setDateWheelColor(int) Color of the date wheel in a com.droidux.widget.wheel.DateTimePicker widget. 
dux_color_timeWheel setTimeWheelColor(int) Color of the time wheel in a com.droidux.widget.wheel.DateTimePicker widget. 
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_todayText Text to be displayed instead of today's date, when the dux_useTodayText is set to true
dux_useTodayText Controls whether the text specified by the dux_todayText should be used instead of 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
DateTimePicker(Context context)
DateTimePicker(Context context, AttributeSet attrs)
Public Methods
int getAmPmWheelColor()
Gets the face color of the AmPm wheel.
int getDateWheelColor()
Gets the face color of the date wheel
View getLeftStaticView()
Gets the static view to be displayed on the left of the selected value, if any.
PickerInterfaces.Listeners.OnDateTimeChangedListener getOnDateTimeChangedListener()
Gets the datetime change listener registered for this view.
View getRightStaticView()
Gets the static view to be displayed on the right of the selected value, if any.
Date getSelectedDate()
Gets the selected date.
int getTimeWheelColor()
Gets the face color of the time wheel.
void setAmPmWheelColor(int color)
Sets the face color of the AmPm wheel.
void setCallbackDuringFling(boolean shouldCallback)
Whether or not to callback on any -changed listener while the items are being flinged.
void setDateWheelColor(int color)
Sets the face color of the date wheel.
void setLeftStaticView(View view)
Sets a static view to be displayed on the left of the selected value.
void setOnDateTimeChangedListener(PickerInterfaces.Listeners.OnDateTimeChangedListener listener)
Register a listener to be notified when the selected datetime is changed.
void setRightStaticView(View view)
Sets a static view to be displayed on the right of the selected value.
void setSelectedDate(Date date, boolean animated)
Sets the selected date to the specified date with the option to animate the change.
void setSelectedDate(Date date)
Set the selected date to the specified date.
void setTimeWheelColor(int color)
Sets the face color of the time wheel
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.DateTimePickerInterface
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_ampmWheel

Since: API Level

Color of the AmPm wheel in a com.droidux.widget.wheel.DateTimePicker 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_dateWheel

Since: API Level

Color of the date wheel in a com.droidux.widget.wheel.DateTimePicker 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_timeWheel

Since: API Level

Color of the time wheel in a com.droidux.widget.wheel.DateTimePicker 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_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_todayText

Since: API Level

Text to be displayed instead of today's date, when the dux_useTodayText is set to true.

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.

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_useTodayText

Since: API Level

Controls whether the text specified by the dux_todayText should be used instead of today's date in a com.droidux.widget.wheel.DateTimePicker widget. Default 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_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 DateTimePicker (Context context)

Since: API Level 2.5

public DateTimePicker (Context context, AttributeSet attrs)

Since: API Level 2.5

Public Methods

public int getAmPmWheelColor ()

Since: API Level 2.5

Gets the face color of the AmPm wheel.

Related XML Attributes
Returns
  • The AmPm color.

public int getDateWheelColor ()

Since: API Level 2.5

Gets the face color of the date wheel

Related XML Attributes
Returns
  • The date 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 PickerInterfaces.Listeners.OnDateTimeChangedListener getOnDateTimeChangedListener ()

Since: API Level 2.5

Gets the datetime change listener registered for this view.

Returns
  • The listener, or null if one is not registered.

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 Date getSelectedDate ()

Since: API Level 2.5

Gets the selected date.

Returns
  • The selected date.

public int getTimeWheelColor ()

Since: API Level 2.5

Gets the face color of the time wheel.

Related XML Attributes
Returns
  • The time wheel.

public void setAmPmWheelColor (int color)

Since: API Level 2.5

Sets the face color of the AmPm wheel.

Related XML Attributes
Parameters
color The AmPm 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 setDateWheelColor (int color)

Since: API Level 2.5

Sets the face color of the date wheel.

Related XML Attributes
Parameters
color The date 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 setOnDateTimeChangedListener (PickerInterfaces.Listeners.OnDateTimeChangedListener listener)

Since: API Level 2.5

Register a listener to be notified when the selected datetime 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 setSelectedDate (Date date, boolean animated)

Since: API Level 2.5

Sets the selected date to the specified date with the option to animate the change.

Parameters
date The selected date.
animated If true, the change will be animated (for example by spinning the date wheel).

public void setSelectedDate (Date date)

Since: API Level 2.5

Set the selected date to the specified date.

Parameters
date The selected date.

public void setTimeWheelColor (int color)

Since: API Level 2.5

Sets the face color of the time wheel

Related XML Attributes
Parameters
color The time color.

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.