API Reference¶
Behaviors¶
- class KXMultiTapGestureRecognizer¶
- on_multi_tap(n_taps: int, touches: Sequence)¶
- Parameters:
n_taps – This equals to
len(touches).touches – The
MotionEventinstances that caused theon_multi_tapevent. They are listed in the order they occurred.
- tap_max_count = 2¶
- tap_max_interval = 0.3¶
- class KXTapGestureRecognizer¶
A
ButtonBehavioralternative for this library.- on_tap(touch)¶
- Parameters:
touch – The
MotionEventinstance that caused theon_tapevent.
- class KXTouchRippleBehavior¶
Unlike the official
TouchRippleBehavior, this one does not clip its drawing area.- ripple_allow_multiple = True¶
Whether multiple ripples can be shown simultaneously via multi-touch.
- ripple_color = '#FFFFFF44'¶
- ripple_duration_in = 0.3¶
Animation duration taken to show the ripple..
- ripple_duration_out = 0.2¶
Animation duration taken to fade the ripple..
- ripple_fadeout_curve = 'linear'¶
Animation curve used to fade out the ripple.
- ripple_final_size = None¶
Final diameter the animation ends to. If set to None, the diameter will be the minimum size required to cover the widget.
- ripple_growth_curve = 'linear'¶
Animation curve used to grow the ripple.
- ripple_initial_size = '20dp'¶
Initial diameter the animation starts from..
- ripple_stop_growing_on_claim_signal = True¶
Whether the ripple stops growing when
touch.ud["kivyx_claim_signal"]fires..
Widgets¶
- class KXScrollView¶
Main differences from the official
ScrollView:When
do_scroll_xis False, the content’s X position can be controlled viapos_hint.When
do_scroll_yis False, the content’s Y position can be controlled viapos_hint.Nested instances work as expected, avoiding many of the issues present in the original.
The content can be scrolled even when it’s smaller than the KXScrollView.
- content = None¶
(read-only)
- content_max_x¶
(read-only) The higher bound of the content’s X position relative to the KXScrollView.
- content_max_y¶
(read-only) The higher bound of the content’s Y position relative to the KXScrollView.
- content_min_x¶
(read-only) The lower bound of the content’s X position relative to the KXScrollView.
- content_min_y¶
(read-only) The lower bound of the content’s Y position relative to the KXScrollView.
- content_pos¶
(read-only) A
ReferenceListPropertyof (content_xandcontent_y) properties.
- content_x¶
(read-only) The X position of the content relative to the KXScrollView.
- content_y¶
(read-only) The Y position of the content relative to the KXScrollView.
- do_overscroll_x = True¶
- do_overscroll_y = True¶
- do_scroll_x¶
- do_scroll_y¶
- effect_x = None¶
Effect to apply for the X axis. If None is set, KXScrollView internally creates an appropriate instance with the following rules:
If
do_overscroll_xis True, it creates aKXDampedScrollEffect.If
do_overscroll_xis False, it creates aKXScrollEffect.
You may want to set this to non-None when:
You want to use a custom effect.
You want to use an existing effect but with a different configuration.
- effect_y = None¶
- hbar_color = '#CCCCCC77'¶
- hbar_enabled = False¶
- hbar_length_min = '10dp'¶
- hbar_thickness = '10dp'¶
- hbar_x¶
(read-only) The X position of the horizontal scrollbar relative to the KXScrollView.
- hbar_y¶
The Y position of the horizontal scrollbar relative to the KXScrollView.
By default, the horizontal scrollbar is placed at the bottom of the KXScrollView. To move it to the top, do the following:
KXScrollView: hbar_y: self.height - self.hbar_thickness
- scroll_by_distance(x=None, y=None)¶
Adjust the momentum to achieve a specified scroll distance.
- scroll_distance¶
- scroll_timeout = 0.2¶
kivy.uix.scrollview.ScrollView.scroll_timeoutbut in seconds
- scroll_to_pos(x=None, y=None)¶
Adjust the momentum to reach a specified scroll position.
- scroll_to_widget(widget)¶
Adjust the momentum to scroll until a specified widget is visible.
- Parameters:
widget – This must be a child or descendant of the
content.
- scroll_wheel_distance¶
- smooth_scroll_end¶
- stop_scroll_momentum()¶
- vbar_color = '#CCCCCC77'¶
- vbar_enabled = False¶
- vbar_length_min = '10dp'¶
- vbar_thickness = '10dp'¶
- vbar_x¶
The X position of the vertical scrollbar relative to the KXScrollView.
By default, the vertical scrollbar is placed on the left side of the KXScrollView. To move it to the right, do the following:
KXScrollView: vbar_x: self.width - self.vbar_thickness
- vbar_y¶
(read-only) The Y position of the vertical scrollbar relative to the KXScrollView.
Effects¶
- class KXScrollEffect¶
A
ScrollEffectequivalence.- friction = 0.05¶
- min_velocity = 16.0¶
- std_dt = 0.017¶
- velocity = 0¶
- class KXDampedScrollEffect¶
A
DampedScrollEffectequivalence.- edge_damping = 0.25¶
- friction = 0.05¶
- min_overscroll = 1.0¶
- min_velocity = 16.0¶
- spring_constant = 1.6¶
kivy.effects.dampedscroll.DampedScrollEffect.spring_constant
- std_dt = 0.017¶
- velocity = 0¶