#:import random random.random #:import RiseInTransition kivy.uix.screenmanager.RiseInTransition #:import SlideTransition kivy.uix.screenmanager.SlideTransition #:import facade plyer.compass #:import rgba kivy.utils.get_color_from_hex : background_color: 1, 1, 1, 1 canvas.before: Color: rgba: root.background_color Rectangle: size: self.size pos: self.pos : background_color: 0, 0, 0, 0 background_color: rgba("#c0464b") : background_color: 0, 0, 0, 0 background_color: rgba("#c0464b") : background_color: 0, 0, 0, 0 background_color: rgba("#c0464b") : MapScreen: CompassScreen: : FloatLayout: MapView: id: mapview zoom: 16 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: source: 'assets/marker_self.png' id: selfmark anchor_x: 0.5 anchor_y: 0 MapMarker: source: 'assets/marker_dest.png' id: centermark anchor_x: 0.5 anchor_y: 0 TextInput: pos_hint: {"x":0.05, "top":0.97} size_hint: 0.9, None height: "32sp" font_size: '20sp' hint_text: 'buscar destino' multiline: False IconButton: pos_hint: {"x":.8, "top":0.95} size_hint: 0.2, 0.2 source: 'assets/to_compass.png' on_press: root.manager.transition = RiseInTransition(); root.manager.current = 'compass'; app.set_destination() IconButton: source: 'assets/to_self.png' pos_hint: {"x":0.8, "top":0.65} size_hint: 0.2, 0.2 on_press: app.center_map_on_gps() IconButton: pos_hint: {"x":0.8, "bottom":0.1} size_hint: 0.2, 0.2 source: 'assets/to_settings.png' on_press: root.manager.transition = SlideTransition(direction='right'); root.manager.current = 'settings' Image: pos_hint: {"x":0.05, "bottom":0.1} size_hint: 0.2, 0.2 source: 'assets/screen_compass.png' : facade: facade orientation: 'vertical' padding: '20dp' spacing: '10dp' FloatLayout: canvas: Color: rgba: rgba(app.theme['bgcolor']) Rectangle: size: self.size Image: id: needle source: app.theme['needle'] pos_hint: {"center_x": 0.5, "center_y": 0.7} canvas.before: PushMatrix Rotate: angle: app.needle_angle axis: 0, 0, 1 origin: self.center canvas.after: PopMatrix Image: id: to_dest source: 'assets/needle_to_dest.png' pos_hint: {"center_x": 0.5, "center_y": 0.7} canvas.before: PushMatrix Rotate: angle: app.dbearing axis: 0, 0, 1 origin: self.center canvas.after: PopMatrix Image: id: to_flock source: 'assets/needle_to_flock.png' pos_hint: {"center_x": 0.5, "center_y": 0.7} canvas.before: PushMatrix Rotate: angle: app.fbearing axis: 0, 0, 1 origin: self.center canvas.after: PopMatrix Image: source: 'assets/pivot.png' pos_hint: {"center_x": 0.5, "center_y": 0.7} size_hint: 1, 1 IconButton: source: app.theme['to_map'] pos_hint: {"center_x": 0.1, "center_y": 0.95} size_hint: 0.2, 0.2 on_press: root.manager.current = 'map'; BackgroundLabel: text: app.dest_distance background_color: rgba("#c0464b") color: rgba("#f3e8d2") size_hint: 1, 0.2 pos_hint: {"x": 0, "top": 0.4} font_size: '40sp' BackgroundLabel: text: app.dashboard_flock background_color: rgba("#679958") color: rgba("#f3e8d2") size_hint: 1, 0.2 pos_hint: {"x": 0, "top": 0.2} font_size: '40sp' : GridLayout: cols: 2 BackgroundLabel: text: "Dark theme" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSwitch: id: dark_theme active: True background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) on_active: app.set_dark_theme(self.active) BackgroundLabel: text: "Compas smoothing" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSlider: id: slider_smoothing background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) min: 0.05 max: 0.99 step: 0.05 orientation: 'horizontal' value: app.session_data['settings_smoothing'] on_value: app.set_smoothing() BackgroundLabel: text: "Compas update frequency" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSlider: id: slider_compass_update background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) min: 0.1 max: 0.9 step: 0.05 orientation: 'horizontal' value: app.session_data['settings_compass_update'] on_value: app.set_compass_update() BackgroundLabel: text: "Update frequency" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSlider: id: slider_update_freq background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) min: 0 max: 1 step: 0.1 orientation: 'horizontal' value: 0.5 BackgroundLabel: text: "Local altruism" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSlider: id: slider_local_altruism background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) min: 0 max: 1 step: 0.1 orientation: 'horizontal' value: 0.1 BackgroundLabel: text: "Destination altruism" background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) font_size: '14sp' BgSlider: id: slider_dest_altruism background_color: rgba(app.theme['bgcolor']) color: rgba(app.theme['fgcolor']) min: 0 max: 1 step: 0.2 orientation: 'horizontal' value: 0.2