42 lines
984 B
Python
42 lines
984 B
Python
|
|
from kivy.app import App
|
||
|
|
from kivy.uix.screenmanager import ScreenManager, Screen, RiseInTransition
|
||
|
|
from kivy.properties import NumericProperty
|
||
|
|
from kivy.lang import Builder
|
||
|
|
from kivy_garden.mapview import MapView
|
||
|
|
|
||
|
|
|
||
|
|
class MapScreen(Screen):
|
||
|
|
hue = NumericProperty(0)
|
||
|
|
mapview = MapView(zoom=11, lat=50.6394, lon=3.057)
|
||
|
|
|
||
|
|
|
||
|
|
class CompassScreen(Screen):
|
||
|
|
hue = NumericProperty(0)
|
||
|
|
|
||
|
|
|
||
|
|
class FlockompassApp(App):
|
||
|
|
|
||
|
|
def build(self):
|
||
|
|
|
||
|
|
root = ScreenManager(transition=RiseInTransition())
|
||
|
|
root.add_widget(MapScreen(name='map'))
|
||
|
|
root.add_widget(CompassScreen(name='compass'))
|
||
|
|
|
||
|
|
return root
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
FlockompassApp().run()
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
# Button:
|
||
|
|
# text: 'Use FallOutTransition'
|
||
|
|
# on_release: root.manager.transition = FallOutTransition()
|
||
|
|
|
||
|
|
# Button:
|
||
|
|
# text: 'Use RiseInTransition'
|
||
|
|
# on_release: root.manager.transition = RiseInTransition()
|
||
|
|
|