Python 3.6.4 - Kivy 1.11.1 - KivyMD 0.104.1
I'm fairly new with Kivy and kivyMD, and even more with threading and shared resources.
Today, I fill in the 3 MDGridlayouts (sbgridfamily, sbgridgender, sbgridspecies) sequentially with SmartTileWithLabels. It works fine, however the loading time is quite long (~5 sec.).
To optimize this loading, I tried
to split the loads in different threads, without using a lock or a semaphore, some cells end up empty.
to remove the MDGridlayouts from the structure and create them on the fly in one thread, then I get an assertion error as soon as I add the first tile to a MDGridlayout.
_apply_rule assert(rule not in self.rulectx) AssertionError
So what would be the best approach to build the MDGridlayouts in parallel?
The screen has the here below structure:
<Screen>
BoxLayout:
orientation:'vertical'
MDToolbar:
title: 'Titre'
...
MDTabs:
Tab:
text: "Famille"
ScrollView:
id: sbgfscrollview
do_scroll_x: False
MDGridLayout:
id: sbgridfamily
...
Tab:
text: "Genre"
ScrollView:
do_scroll_x: False
MDGridLayout:
id: sbgridgender
cols: 3
...
Tab:
text: "Esp\u00E8ce"
ScrollView:
do_scroll_x: False
MDGridLayout:
id: sbgridspecies
cols: 4
...
# Will always be at the bottom of the screen.
BottomAppBar: