API Reference

Behaviors

class KXMultiTapGestureRecognizer
on_multi_tap(n_taps: int, touches: Sequence)
Parameters:
  • n_taps – This equals to len(touches).

  • touches – The MotionEvent instances that caused the on_multi_tap event. They are listed in the order they occurred.

tap_max_count = 2
tap_max_interval = 0.3
class KXTapGestureRecognizer

A ButtonBehavior alternative for this library.

on_tap(touch)
Parameters:

touch – The MotionEvent instance that caused the on_tap event.

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_x is False, the content’s X position can be controlled via pos_hint.

  • When do_scroll_y is False, the content’s Y position can be controlled via pos_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 ReferenceListProperty of (content_x and content_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

kivy.uix.scrollview.ScrollView.do_scroll_x

do_scroll_y

kivy.uix.scrollview.ScrollView.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:

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

kivy.uix.scrollview.ScrollView.scroll_distance

scroll_timeout = 0.2

kivy.uix.scrollview.ScrollView.scroll_timeout but 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

kivy.uix.scrollview.ScrollView.scroll_wheel_distance

smooth_scroll_end

kivy.uix.scrollview.ScrollView.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 ScrollEffect equivalence.

friction = 0.05

kivy.effects.kinetic.KineticEffect.friction

max = 0

kivy.effects.scroll.ScrollEffect.max

min = 0

kivy.effects.scroll.ScrollEffect.min

min_velocity = 16.0

kivy.effects.kinetic.KineticEffect.min_velocity

scroll_by(distance)

Adjust the velocity to achieve a specified movement distance.

scroll_to(new_value)

Adjust the velocity to reach a specified value.

std_dt = 0.017

kivy.effects.kinetic.KineticEffect.std_dt

value = 0

kivy.effects.kinetic.KineticEffect.value

velocity = 0

kivy.effects.kinetic.KineticEffect.velocity

class KXDampedScrollEffect

A DampedScrollEffect equivalence.

edge_damping = 0.25

kivy.effects.dampedscroll.DampedScrollEffect.edge_damping

friction = 0.05

kivy.effects.kinetic.KineticEffect.friction

max = 0

kivy.effects.scroll.ScrollEffect.max

min = 0

kivy.effects.scroll.ScrollEffect.min

min_overscroll = 1.0

kivy.effects.dampedscroll.DampedScrollEffect.min_overscroll

min_velocity = 16.0

kivy.effects.kinetic.KineticEffect.min_velocity

scroll_by(distance)

Adjust the velocity to achieve a specified movement distance.

scroll_to(new_value)

Adjust the velocity to reach a specified value.

spring_constant = 1.6

kivy.effects.dampedscroll.DampedScrollEffect.spring_constant

std_dt = 0.017

kivy.effects.kinetic.KineticEffect.std_dt

value = 0

kivy.effects.kinetic.KineticEffect.value

velocity = 0

kivy.effects.kinetic.KineticEffect.velocity