flockompass/flockompass.kv

112 lines
3.3 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>:
2020-08-28 04:40:20 +00:00
FloatLayout:
MapView:
2020-08-28 04:40:20 +00:00
id: mapview
zoom: 16
2020-08-05 02:52:20 +00:00
2020-08-28 04:40:20 +00:00
on_map_relocated:
centermark.lat = mapview.lat
centermark.lon = mapview.lon
selfmark.lat = app.gps_data.get('lat', 0)
selfmark.lon = app.gps_data.get('lon', 0)
MapMarker:
2020-08-28 17:34:16 +00:00
source: 'assets/marker_self.png'
2020-08-28 04:40:20 +00:00
id: selfmark
anchor_x: 0.5
anchor_y: 0
2020-07-17 00:17:49 +00:00
MapMarker:
2020-08-28 17:34:16 +00:00
source: 'assets/marker_dest.png'
2020-07-17 00:17:49 +00:00
id: centermark
2020-08-28 04:40:20 +00:00
anchor_x: 0.5
anchor_y: 0
TextInput:
pos_hint: {"x":0.05, "top":0.97}
2020-08-28 05:17:56 +00:00
size_hint: 0.9, None
height: "32sp"
font_size: '20sp'
hint_text: 'buscar destino'
2020-08-28 04:40:20 +00:00
multiline: False
2020-08-28 17:22:30 +00:00
IconButton:
pos_hint: {"x":.8, "top":0.95}
size_hint: 0.2, 0.2
2020-08-28 17:34:16 +00:00
source: 'assets/dark_to_compass_icon.png'
2020-08-28 17:22:30 +00:00
on_press: root.manager.current = 'compass'; app.set_destination()
IconButton:
2020-08-28 17:34:16 +00:00
source: 'assets/to_self.png'
2020-08-28 17:22:30 +00:00
pos_hint: {"x":0.4, "bottom":0.1}
size_hint: 0.2, 0.2
2020-08-28 04:40:20 +00:00
on_press: app.center_map_on_gps()
2020-08-28 17:22:30 +00:00
IconButton:
pos_hint: {"x":0.8, "bottom":0.1}
size_hint: 0.2, 0.2
2020-08-28 17:34:16 +00:00
source: 'assets/to_settings.png'
2020-08-28 17:22:30 +00:00
on_press: root.manager.current = 'settings';
<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';
FloatLayout:
canvas:
Color:
2020-08-11 18:12:10 +00:00
rgb: .9, .9, .9
2020-08-11 04:50:25 +00:00
Rectangle:
size: self.size
2020-08-11 21:59:55 +00:00
Label:
text: app.dest_distance
color: 0, 0, 0.3, 1
size_hint: 0.5, 0.1
pos: 0, 0.1
font_size: '40sp'
2020-08-11 04:50:25 +00:00
Image:
2020-08-28 17:34:16 +00:00
source: 'assets/needle.png'
2020-08-11 04:50:25 +00:00
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:
2020-08-12 01:37:56 +00:00
id: to_dest
2020-08-28 17:34:16 +00:00
source: 'assets/needle_to_dest.png'
2020-08-11 05:27:57 +00:00
canvas.before:
PushMatrix
Rotate:
angle: app.fbearing
axis: 0, 0, 1
origin: self.center
canvas.after:
PopMatrix
2020-08-28 04:40:20 +00:00
Image:
2020-08-28 17:34:16 +00:00
source: 'assets/pivot.png'