Carousel#
Carousel
class equivalent. Simplifies working
with some widget properties. For example:Carousel#
kv='''
YourCarousel:
BoxLayout:
[...]
BoxLayout:
[...]
BoxLayout:
[...]
'''
builder.load_string(kv)
class YourCarousel(Carousel):
def __init__(self,*kwargs):
self.register_event_type("on_slide_progress")
self.register_event_type("on_slide_complete")
def on_touch_down(self, *args):
["Code to detect when the slide changes"]
def on_touch_up(self, *args):
["Code to detect when the slide changes"]
def Calculate_slide_pos(self, *args):
["Code to calculate the current position of the slide"]
def do_custom_animation(self, *args):
["Code to recreate an animation"]
MDCarousel#
MDCarousel:
on_slide_progress:
do_something()
on_slide_complete:
do_something()
API - kivymd.uix.carousel
#
- class kivymd.uix.carousel.MDCarousel(*args, **kwargs)#
based on kivy’s carousel.
See also
- on_slide_progress(self, *args)#
Event launched when the Slide animation is progress. remember to bind and unbid to this method.
- on_slide_complete(self, *args)#
Event launched when the Slide animation is complete. remember to bind and unbid to this method.
- on_touch_down(self, touch)#
Receive a touch down event.
- Parameters:
- touch:
MotionEvent
class Touch received. The touch is in parent coordinates. See
relativelayout
for a discussion on coordinate systems.
- touch:
- Returns:
bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.
- on_touch_up(self, touch)#
Receive a touch up event. The touch is in parent coordinates.
See
on_touch_down()
for more information.