Spinner¶
Circular progress indicator in Google’s Material Design.
Usage¶
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
Screen:
MDSpinner:
size_hint: None, None
size: dp(46), dp(46)
pos_hint: {'center_x': .5, 'center_y': .5}
active: True if check.active else False
MDCheckbox:
id: check
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': .5, 'center_y': .4}
active: True
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
API - kivymd.uix.spinner¶
-
class
kivymd.uix.spinner.MDSpinner(**kwargs)¶ Bases:
kivymd.theming.ThemableBehavior,kivy.uix.widget.WidgetMDSpinneris an implementation of the circular progress indicator in Google’s Material Design.It can be used either as an indeterminate indicator that loops while the user waits for something to happen, or as a determinate indicator.
Set
determinateto True to activate determinate mode, anddeterminate_timeto set the duration of the animation.-
determinate¶ determinateis aBooleanPropertyand defaults to False.
-
determinate_time¶ determinate_timeis aNumericPropertyand defaults to 2.
-
active¶ Use
activeto start or stop the spinner.activeis aBooleanPropertyand defaults to True.
-
color¶ coloris aListPropertyand defaults toself.theme_cls.primary_color.
-
on__rotation_angle(self, *args)¶
-
on_active(self, *args)¶
-