KivyMD icon indicating copy to clipboard operation
KivyMD copied to clipboard

TapTargetView: Demo crashes on the last touch.

Open podraco opened this issue 3 years ago • 6 comments

Description of the Bug

using the kitchen sink app i found out that the demo screen crashes on the last touch.

Code and Logs

using the kitchen sink demo without alterations.

[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "%HOME%\Documents\git\kivymd\KivyMD\demos\kitchen_sink\main.py", line 144, in <module>
     KitchenSinkApp().run()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\app.py", line 950, in run
     runTouchApp()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\base.py", line 582, in runTouchApp
     EventLoop.mainloop()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\base.py", line 347, in mainloop
     self.idle()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\base.py", line 387, in idle
     Clock.tick()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\clock.py", line 733, in tick
     self.post_idle(ts, self.idle())
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\clock.py", line 776, in post_idle
     self._process_events()
   File "kivy\_clock.pyx", line 616, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\animation.py", line 353, in _update
     self.stop(widget)
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivy\animation.py", line 218, in stop
     self.dispatch('on_complete', widget)
   File "kivy\_event.pyx", line 705, in kivy._event.EventDispatcher.dispatch
   File "kivy\_event.pyx", line 1248, in kivy._event.EventObservers.dispatch
   File "kivy\_event.pyx", line 1172, in kivy._event.EventObservers._dispatch
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivymd\uix\taptargetview.py", line 618, in _after_stop
     self._fix_elev()
   File "%HOME%\AppData\Roaming\Python\Python37\site-packages\kivymd\uix\taptargetview.py", line 631, in _fix_elev
     size=self.widget._soft_shadow_size,
   File "kivy\weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy.__getattr__
 AttributeError: 'MDFloatingActionButton' object has no attribute '_soft_shadow_size'
[Finished in 151.591s]

"""

Versions

* OS:  NT 10
* Python: 3.7
* Kivy: 2.0+
* KivyMD: master

podraco avatar Apr 22 '21 11:04 podraco

the Tap Target View uses a lot of new instructions while the animation is runnig, as well, replaces every canvas instruction from the canvas.before of the widget to be used, this creates a lot of new canvas instruction instances every time the class starts, animates and stops, as well breaks the shadows of the widget, as they are replaced by the taptargetview, in a similar way as they where defined on the elevation behavior. this takes control from the elevation behavior class, which is a bad practice. i'm working on creating a layer, in wich tap target view can work freelie without breaking anything from other classes.

podraco avatar Apr 25 '21 03:04 podraco

is it solved or not ? i am facing same problem

Sahil-pixel avatar May 20 '21 13:05 Sahil-pixel

@Sahil-pixel I haven't noticed any bugs when using the TapTargetView class. I may not have used this class much.

HeaTTheatR avatar May 20 '21 13:05 HeaTTheatR

This problem reproduces using the example here : https://kivymd.readthedocs.io/en/latest/components/taptargetview/

brentpicasso avatar Jun 08 '21 05:06 brentpicasso

Hi @HeaTTheatR @brentpicasso @Sahil-pixel I tested it today and this issue is not still fixed

BaggioMarco avatar Dec 12 '21 19:12 BaggioMarco

@BaggioMarco The issue is open ...

HeaTTheatR avatar Dec 12 '21 19:12 HeaTTheatR