Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def on_touch_down(self, touch):
- if self.collide_point(touch.x, touch.y):
- self.parent.index = self._index
- temp_color = App.get_running_app().theme_cls.primary_color
- temp_color[3] = .4
- ellipse_group = InstructionGroup()
- ellipse_group.add(Color(*App.get_running_app().theme_cls.primary_color))
- ellipse = Ellipse(size=(self.height, self.height), pos=(self.ids.day.center_x - self.height / 2,
- self.ids.day.center_y - self.height / 2))
- circle = Line(circle=(self.ids.day.center_x, self.ids.day.center_y, self.radius), width=dp(2.5))
- self.bind(radius=lambda *x: on_radius())
- ellipse_group.add(circle)
- ellipse_group.add(Color(*temp_color))
- ellipse_group.add(ellipse)
- self.canvas.add(ellipse_group)
- anim = Animation(width=dp(5.5),
- duration=self.duration)
- anim.bind(on_complete=lambda *largs: animate())
- anim.start(circle)
- anim2 = Animation(radius=dp(20))
- anim2.start(self)
- self.callback(self)
- def on_radius():
- circle.circle = (self.ids.day.center_x, self.ids.day.center_y, self.radius)
- def animate():
- ellipse_group.remove(ellipse)
- anim2 = Animation(width=.1, duration=self.duration)
- anim2.bind(on_complete=lambda *largs: animate_1())
- anim2.start(circle)
- def animate_1():
- self.canvas.remove(ellipse_group)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement