5
Based on the :class:`~kivy.effects.damped.DampedScrollEffect`, this one will
6
also decrease the opacity of the target widget during the overscroll.
10
__all__ = ('OpacityScrollEffect', )
13
from kivy.effects.dampedscroll import DampedScrollEffect
16
class OpacityScrollEffect(DampedScrollEffect):
17
'''OpacityScrollEffect class. Uses the overscroll
18
information to reduce the opacity of the scrollview widget. When the user
19
stops the drag, the opacity is set back to 1.
22
def on_overscroll(self, *args):
23
if self.target_widget and self.target_widget.height != 0:
25
abs(self.overscroll / float(self.target_widget.height)))
26
self.target_widget.opacity = min(1, alpha)
27
self.trigger_velocity_update()