87 lines
2.4 KiB
Plaintext
87 lines
2.4 KiB
Plaintext
#:import random random.random
|
|
#:import RiseInTransition kivy.uix.screenmanager.RiseInTransition
|
|
#:import facade plyer.compass
|
|
|
|
|
|
<RootScreen>:
|
|
MapScreen:
|
|
CompassScreen:
|
|
|
|
|
|
<MapScreen>:
|
|
BoxLayout:
|
|
orientation: 'vertical'
|
|
ActionBar:
|
|
pos_hint: {'top':1}
|
|
ActionView:
|
|
use_separator: True
|
|
ActionPrevious:
|
|
title: 'Social Cycling'
|
|
with_previous: False
|
|
ActionButton:
|
|
important: True
|
|
text: 'we ride together'
|
|
on_press: root.manager.current = 'compass'; app.set_destination()
|
|
MapView:
|
|
id: mapview
|
|
zoom: 16
|
|
|
|
on_map_relocated: centermark.lat = mapview.lat; centermark.lon = mapview.lon
|
|
|
|
MapMarker:
|
|
source: 'marker.png'
|
|
id: centermark
|
|
#anchor_x: 0.2
|
|
#anchor_y: 0.3
|
|
|
|
|
|
|
|
<CompassScreen>:
|
|
facade: facade
|
|
orientation: 'vertical'
|
|
padding: '20dp'
|
|
spacing: '10dp'
|
|
BoxLayout:
|
|
orientation: 'vertical'
|
|
ActionBar:
|
|
pos_hint: {'top':1}
|
|
ActionView:
|
|
use_separator: True
|
|
ActionPrevious:
|
|
title: 'Social Cycling'
|
|
with_previous: False
|
|
ActionButton:
|
|
important: True
|
|
text: 'set destination'
|
|
on_press: root.manager.current = 'map';
|
|
|
|
FloatLayout:
|
|
canvas:
|
|
Color:
|
|
rgb: .08, .08, .08
|
|
Rectangle:
|
|
size: self.size
|
|
Image:
|
|
source: 'rose.png'
|
|
Image:
|
|
source: 'needle.png'
|
|
canvas.before:
|
|
PushMatrix
|
|
Rotate:
|
|
angle: app.needle_angle
|
|
axis: 0, 0, 1
|
|
origin: self.center
|
|
canvas.after:
|
|
PopMatrix
|
|
Image:
|
|
id: to_flock
|
|
source: 'needle_to_flock.png'
|
|
canvas.before:
|
|
PushMatrix
|
|
Rotate:
|
|
angle: app.fbearing
|
|
axis: 0, 0, 1
|
|
origin: self.center
|
|
canvas.after:
|
|
PopMatrix
|