Circular Date & Time Picker for Kivy

(currently only time, date coming soon)

Based on [CircularLayout](https://github.com/kivy-garden/garden.circularlayout). The main aim is to provide a date and time selector similar to the one found in Android KitKat+.

Simple usage

Import the widget with

from kivy.garden.circulardatetimepicker import CircularTimePicker

then use it! That’s it!

c = CircularTimePicker()
c.bind(time=self.set_time)
root.add_widget(c)

in Kv language:

<TimeChooserPopup@Popup>:
    BoxLayout:
        orientation: "vertical"

        CircularTimePicker

        Button:
            text: "Dismiss"
            size_hint_y: None
            height: "40dp"
            on_release: root.dismiss()

API - kivymd.vendor.circularTimePicker

class kivymd.vendor.circularTimePicker.CircularLayout(**kwargs)

Bases: kivy.uix.layout.Layout

Circular layout class. See module documentation for more information.

padding

Padding between the layout box and it’s children: [padding_left, padding_top, padding_right, padding_bottom].

padding also accepts a two argument form [padding_horizontal, padding_vertical] and a one argument form [padding].

padding is a VariableListProperty and defaults to [0, 0, 0, 0].

start_angle

Angle (in degrees) at which the first widget will be placed. Start counting angles from the X axis, going counterclockwise.

start_angle is a NumericProperty and defaults to 0 (start from the right).

circle_quota

Size (in degrees) of the part of the circumference that will actually be used to place widgets.

circle_quota is a BoundedNumericProperty and defaults to 360 (all the circumference).

direction

Direction of widgets in the circle.

direction is an OptionProperty and defaults to ‘ccw’. Can be ‘ccw’ (counterclockwise) or ‘cw’ (clockwise).

outer_radius_hint

Sets the size of the outer circle. A number greater than 1 will make the widgets larger than the actual widget, a number smaller than 1 will leave a gap.

outer_radius_hint is a NumericProperty and defaults to 1.

inner_radius_hint

Sets the size of the inner circle. A number greater than outer_radius_hint will cause glitches. The closest it is to outer_radius_hint, the smallest will be the widget in the layout.

outer_radius_hint is a NumericProperty and defaults to 1.

radius_hint

Combined outer_radius_hint and inner_radius_hint in a list for convenience. See their documentation for more details.

radius_hint is a ReferenceListProperty.

delta_radii
do_layout(self, *largs)
class kivymd.vendor.circularTimePicker.ThemableBehavior(**kwargs)

Bases: kivy.event.EventDispatcher

theme_cls

Instance of ThemeManager class.

theme_cls is an ObjectProperty.

device_ios

True if device is iOS.

device_ios is an BooleanProperty.

opposite_colors
kivymd.vendor.circularTimePicker.xrange(first=None, second=None, third=None)
kivymd.vendor.circularTimePicker.map_number(x, in_min, in_max, out_min, out_max)
kivymd.vendor.circularTimePicker.rgb_to_hex(*color)
class kivymd.vendor.circularTimePicker.Number

Bases: kivy.uix.label.Label

The class used to show the numbers in the selector.

size_factor

Font size scale.

size_factor is a NumericProperty and defaults to 0.5.

class kivymd.vendor.circularTimePicker.CircularNumberPicker(**kw)

Bases: kivymd.vendor.circleLayout.CircularLayout

A circular number picker based on CircularLayout. A selector will help you pick a number. You can also set multiples_of to make it show only some numbers and use the space in between for the other numbers.

min

The first value of the range.

min is a NumericProperty and defaults to 0.

max

The last value of the range. Note that it behaves like xrange, so the actual last displayed value will be max - 1.

max is a NumericProperty and defaults to 0.

range

Packs min and max into a list for convenience. See their documentation for further information.

range is a ReferenceListProperty.

multiples_of

Only show numbers that are multiples of this number. The other numbers will be selectable, but won’t have their own label.

multiples_of is a NumericProperty and defaults to 1.

selector_color

Color of the number selector. RGB.

selector_color is a ListProperty and defaults to [.337, .439, .490] (material green).

color

Color of the number labels and of the center dot. RGB.

color is a ListProperty and defaults to [1, 1, 1] (white).

selector_alpha

Alpha value for the transparent parts of the selector.

selector_alpha is a BoundedNumericProperty and defaults to 0.3 (min=0, max=1).

selected

Currently selected number.

selected is a NumericProperty and defaults to min.

number_size_factor

Font size scale factor for the Number.

number_size_factor is a NumericProperty and defaults to 0.5.

number_format_string

String that will be formatted with the selected number as the first argument. Can be anything supported by str.format() (es. “{:02d}”).

number_format_string is a StringProperty and defaults to “{}”.

scale

Canvas scale factor. Used in CircularTimePicker transitions.

scale is a NumericProperty and defaults to 1.

items
shown_items
dot_is_none(self, *args)
on_touch_down(self, touch)
on_touch_move(self, touch)
on_touch_up(self, touch)
on_selected(self, *a)
pos_for_number(self, n)

Returns the center x, y coordinates for a given number.

number_at_pos(self, x, y)

Returns the number at a given x, y position. The number is found using the widget’s center as a starting point for angle calculations.

Not thoroughly tested, may yield wrong results.

class kivymd.vendor.circularTimePicker.CircularMinutePicker(**kw)

Bases: kivymd.vendor.circularTimePicker.CircularNumberPicker

CircularNumberPicker implementation for minutes.

class kivymd.vendor.circularTimePicker.CircularHourPicker(**kw)

Bases: kivymd.vendor.circularTimePicker.CircularNumberPicker

CircularNumberPicker implementation for hours.

class kivymd.vendor.circularTimePicker.CircularTimePicker(**kw)

Bases: kivy.uix.boxlayout.BoxLayout, kivymd.theming.ThemableBehavior

Widget that makes use of CircularHourPicker and CircularMinutePicker to create a user-friendly, animated time picker like the one seen on Android.

See module documentation for more details.

primary_dark
hours

The hours, in military format (0-23).

hours is a NumericProperty and defaults to 0 (12am).

minutes

The minutes.

minutes is a NumericProperty and defaults to 0.

time_list

Packs hours and minutes in a list for convenience.

time_list is a ReferenceListProperty.

time_format

String that will be formatted with the time and shown in the time label. Can be anything supported by str.format(). Make sure you don’t remove the refs. See the default for the arguments passed to format. time_format is a StringProperty and defaults to “[color={hours_color}][ref=hours]{hours}[/ref][/color]:[color={minutes_color}][ref=minutes] {minutes:02d}[/ref][/color]”.

ampm_format

String that will be formatted and shown in the AM/PM label. Can be anything supported by str.format(). Make sure you don’t remove the refs. See the default for the arguments passed to format.

ampm_format is a StringProperty and defaults to “[color={am_color}][ref=am]AM[/ref][/color]

[color={pm_color}][ref=pm]PM[/ref][/color]”.

picker

Currently shown time picker. Can be one of “minutes”, “hours”.

picker is a OptionProperty and defaults to “hours”.

selector_color

Color of the number selector and of the highlighted text. RGB.

selector_color is a ListProperty and defaults to [.337, .439, .490] (material green).

color

Color of the number labels and of the center dot. RGB.

color is a ListProperty and defaults to [1, 1, 1] (white).

selector_alpha

Alpha value for the transparent parts of the selector.

selector_alpha is a BoundedNumericProperty and defaults to 0.3 (min=0, max=1).

time

Selected time as a datetime.time object.

time is an AliasProperty.

time_text
ampm_text
set_time(self, dt)
on_ref_press(self, ign, ref)
on_selected(self, *a)
on_time_list(self, *a)
on_ampm(self, *a)
is_animating(self, *args)
is_not_animating(self, *args)
on_touch_down(self, touch)
on_touch_up(self, touch)
kivymd.vendor.circularTimePicker.c