flockompass/flockompass.kv

91 lines
2.6 KiB
Plaintext
Raw Normal View History

#:import random random.random
#:import RiseInTransition kivy.uix.screenmanager.RiseInTransition
2020-08-11 04:50:25 +00:00
#:import facade plyer.compass
2020-07-16 17:14:47 +00:00
2020-08-05 02:52:20 +00:00
<RootScreen>:
2020-08-11 04:50:25 +00:00
MapScreen:
2020-08-05 02:52:20 +00:00
CompassScreen:
2020-07-16 17:14:47 +00:00
<MapScreen>:
BoxLayout:
2020-07-16 17:14:47 +00:00
orientation: 'vertical'
ActionBar:
pos_hint: {'top':1}
ActionView:
use_separator: True
ActionPrevious:
title: 'Social Cycling'
with_previous: False
2020-08-11 16:31:25 +00:00
ActionButton:
important: False
text: 'go to current loc'
on_press: app.center_map_on_gps()
2020-07-16 17:14:47 +00:00
ActionButton:
2020-07-17 00:17:49 +00:00
important: True
2020-07-16 17:14:47 +00:00
text: 'we ride together'
on_press: root.manager.current = 'compass'; app.set_destination()
MapView:
id: mapview
zoom: 16
2020-08-05 02:52:20 +00:00
on_map_relocated: centermark.lat = mapview.lat; centermark.lon = mapview.lon
2020-07-17 00:17:49 +00:00
MapMarker:
2020-07-17 00:17:49 +00:00
source: 'marker.png'
id: centermark
#anchor_x: 0.2
#anchor_y: 0.3
<CompassScreen>:
2020-08-11 04:50:25 +00:00
facade: facade
2020-07-16 22:42:33 +00:00
orientation: 'vertical'
padding: '20dp'
spacing: '10dp'
BoxLayout:
2020-07-16 22:42:33 +00:00
orientation: 'vertical'
2020-08-04 22:41:17 +00:00
ActionBar:
pos_hint: {'top':1}
ActionView:
use_separator: True
ActionPrevious:
title: 'Social Cycling'
with_previous: False
ActionButton:
important: True
text: 'set destination'
2020-08-11 04:50:25 +00:00
on_press: root.manager.current = 'map';
2020-07-16 18:43:28 +00:00
2020-08-11 04:50:25 +00:00
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
2020-08-11 05:27:57 +00:00
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