Would an approach similar to the example below be possible in Kivy?
The code posted obviously doesn't work, and again it's only an example: I will need different layouts to be drawn depending on a certain property.
How would you suggest working this out?
BoxLayout:
number: 0
if self.number > 3:
Label:
text: 'number is bigger than 3'
Button:
text: 'click here to decrease'
on_press: root.number -= 1
else:
Label:
text: 'number is smaller than 3'
Button:
text: 'click here to increase'
on_press: root.number += 1
I would go with ScreenManager or a Carousel, a simple example might be:
If you'll bind index to a property of your choice it will automatically switch the layout :)...
A ScreenManager based approach will be quite similar, the major change is only binding the current_screen property instead of index