public class

TimePicker

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

Class Overview

A view that allows users to pick 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_hourWheel setHourWheelColor(int) Color of the hour wheel in a com.droidux.widget.wheel.TimePicker widget. 
dux_color_minuteWheel setMinuteWheelColor(int) Color of the minutes wheel in a com.droidux.widget.wheel.DatePicker 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_is24HourMode Controls whether the time mode in a com.droidux.widget.wheel.TimePicker is in 24-hour mode. 
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_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
TimePicker(Context context)
TimePicker(Context context, AttributeSet attrs)
Public Methods
int getAmPmWheelColor()
Gets the face color of the AmPm wheel.
int getHour()
Gets the selected hour of the day.
int getHourWheelColor()
Gets the face color of the hour wheel.
View getLeftStaticView()
Gets the static view to be displayed on the left of the selected value, if any.
int getMinute()
Gets the selected minute.
int getMinuteWheelColor()
Gets the face color of the minute wheel.
PickerInterfaces.Listeners.OnTimeChangedListener getOnTimeChangedListener()
Gets the time change listener registered for this view.
View getRightStaticView()
Gets the static view to be displayed on the right of the selected value, if any.
boolean is24HourMode()
Checks whether the time displayed is 24-hour mode.
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 setHourWheelColor(int color)
Sets the face color of the hour wheel.
void setLeftStaticView(View view)
Sets a static view to be displayed on the left of the selected value.
void setMinuteWheelColor(int color)
Sets the face color of the minute wheel.
void setOnTimeChangedListener(PickerInterfaces.Listeners.OnTimeChangedListener listener)
Registers the listener to be notified when the time is changed.
void setRightStaticView(View view)
Sets a static view to be displayed on the right of the selected value.
void updateTime(int hour, int minute)
Update the time to the specified values.
void updateTime(int hour, int minute, boolean animated)
Update the time to the specified values with option to animate the change.
Protected Methods
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.TimePickerInterface
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_hourWheel

Since: API Level

Color of the hour wheel in a com.droidux.widget.wheel.TimePicker 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_minuteWheel

Since: API Level

Color of the minutes 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_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_is24HourMode

Since: API Level

Controls whether the time mode in a com.droidux.widget.wheel.TimePicker is in 24-hour mode. In 24-hour mode, the AmPm wheel will not be displayed. Default is false.

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_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_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 TimePicker (Context context)

Since: API Level 2.5

public TimePicker (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 getHour ()

Since: API Level 2.5

Gets the selected hour of the day.

Returns
  • The selected hour. Between 0-23 inclusive.

public int getHourWheelColor ()

Since: API Level 2.5

Gets the face color of the hour wheel.

Related XML Attributes
Returns
  • The hour 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 getMinute ()

Since: API Level 2.5

Gets the selected minute.

Returns
  • The selected minute.

public int getMinuteWheelColor ()

Since: API Level 2.5

Gets the face color of the minute wheel.

Related XML Attributes
Returns
  • The minute color.

public PickerInterfaces.Listeners.OnTimeChangedListener getOnTimeChangedListener ()

Since: API Level 2.5

Gets the time 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 boolean is24HourMode ()

Since: API Level 2.5

Checks whether the time displayed is 24-hour mode.

Returns
  • If true, only the hour and minute spinner will be displayed. Otherwise, the AmPm spinner will be shown also.

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 setHourWheelColor (int color)

Since: API Level 2.5

Sets the face color of the hour wheel.

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

Since: API Level 2.5

Sets the face color of the minute wheel.

Related XML Attributes
Parameters
color The minute color.

public void setOnTimeChangedListener (PickerInterfaces.Listeners.OnTimeChangedListener listener)

Since: API Level 2.5

Registers the listener to be notified when the time 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 updateTime (int hour, int minute)

Since: API Level 2.5

Update the time to the specified values.

Parameters
hour The selected hour.
minute The selected minute.

public void updateTime (int hour, int minute, boolean animated)

Since: API Level 2.5

Update the time to the specified values with option to animate the change.

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

Protected Methods

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.