updated view
This commit is contained in:
302
traccar.kv
302
traccar.kv
@@ -146,191 +146,179 @@
|
||||
|
||||
<HomeScreen>:
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
padding: 10
|
||||
spacing: 10
|
||||
orientation: 'vertical'
|
||||
padding: [8, 8, 8, 8]
|
||||
spacing: 8
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.11, 0.10, 0.15, 1 # Background color: #1C1A27
|
||||
rgba: 0.11, 0.10, 0.15, 1 # Match app background
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
Label:
|
||||
text: "Welcome to Home Screen"
|
||||
font_size: 24
|
||||
text: "Your Trips"
|
||||
font_size: 20
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
color: 1, 1, 1, 1 # White text color
|
||||
height: 40
|
||||
color: 1, 1, 1, 1
|
||||
|
||||
ScrollView:
|
||||
size_hint: (1, 0.6)
|
||||
do_scroll_x: False
|
||||
GridLayout:
|
||||
id: projects_list
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
spacing: 4
|
||||
|
||||
Button:
|
||||
text: "Create New Project / Trip"
|
||||
text: "Create New Trip"
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
|
||||
height: 48
|
||||
background_color: 0.341, 0.235, 0.980, 1
|
||||
color: 1, 1, 1, 1
|
||||
font_size: 16
|
||||
on_press: root.create_new_project()
|
||||
|
||||
Label:
|
||||
id: result_label
|
||||
text: ""
|
||||
size_hint_y: None
|
||||
height: 30
|
||||
color: 1, 1, 1, 1 # White text color
|
||||
|
||||
<GetTripFromServer>:
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
padding: 20
|
||||
spacing: 20
|
||||
padding: [12, 0, 12, 12]
|
||||
spacing: 18
|
||||
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.11, 0.10, 0.15, 1 # Background color: #1C1A27
|
||||
rgba: 0.11, 0.10, 0.15, 1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
# First row: Server settings
|
||||
# Responsive Server info row
|
||||
BoxLayout:
|
||||
id: server_info_settings
|
||||
orientation: "horizontal"
|
||||
id: server_info_box
|
||||
orientation: 'horizontal' if self.width > 400 else 'vertical'
|
||||
size_hint_y: None
|
||||
height: 30
|
||||
height: 40 if self.width > 400 else 80
|
||||
spacing: 10
|
||||
padding: [10, 10, 10, 10]
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: root.server_box_color # Dynamic color for the box
|
||||
rgba: root.server_box_color
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
Label:
|
||||
id: server_info_label
|
||||
text: root.server_info_text # Dynamic text for the label
|
||||
font_size: 14 # Reduced font size
|
||||
size_hint_x: 0.8
|
||||
|
||||
text: root.server_info_text
|
||||
font_size: 15
|
||||
size_hint_x: 0.7 if server_info_box.orientation == 'horizontal' else 1
|
||||
size_hint_y: 1
|
||||
halign: 'left'
|
||||
valign: 'middle'
|
||||
text_size: self.size
|
||||
Button:
|
||||
text: "Settings"
|
||||
size_hint_x: 0.2
|
||||
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
|
||||
size_hint_x: 0.3 if server_info_box.orientation == 'horizontal' else 1
|
||||
size_hint_y: 1
|
||||
font_size: 15
|
||||
background_color: 0.341, 0.235, 0.980, 1
|
||||
on_press: app.root.current = "settings"
|
||||
|
||||
# Second row: Frame for device and date selection
|
||||
# Device and date selection
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: 200 # Adjusted height for the frame
|
||||
spacing: 10
|
||||
padding: 10
|
||||
height: 300
|
||||
spacing: 14
|
||||
padding: 14
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.2, 0.2, 0.2, 1 # Frame background color
|
||||
rgba: 0.2, 0.2, 0.2, 1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
Label:
|
||||
text: "Select device and the day of the data" # Main label
|
||||
font_size: 14 # Reduced font size
|
||||
text: "Select device and date"
|
||||
font_size: 15
|
||||
size_hint_y: None
|
||||
height: 20
|
||||
height: 22
|
||||
|
||||
Spinner:
|
||||
id: devices_spinner
|
||||
text: "Loading devices..."
|
||||
values: []
|
||||
size_hint_y: None
|
||||
height: 38
|
||||
font_size: 15
|
||||
on_text: root.on_device_selected(self.text)
|
||||
|
||||
BoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
height: 30
|
||||
spacing: 10
|
||||
|
||||
Spinner:
|
||||
id: devices_spinner
|
||||
text: "Loading devices..." # Default text
|
||||
values: [] # Initially empty
|
||||
size_hint: (0.5, None)
|
||||
height: 25
|
||||
font_size: 14
|
||||
on_text: root.on_device_selected(self.text)
|
||||
|
||||
# New row: Starting date and hour
|
||||
BoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
height: 30
|
||||
spacing: 10
|
||||
|
||||
height: 38
|
||||
spacing: 8
|
||||
Label:
|
||||
text: "Starting Date"
|
||||
size_hint_x: 0.3
|
||||
font_size: 14
|
||||
|
||||
text: "Start"
|
||||
font_size: 13
|
||||
size_hint_x: 0.18
|
||||
Button:
|
||||
id: start_date_picker_button
|
||||
text: "Select Start Date"
|
||||
size_hint_x: 0.4
|
||||
height: 25
|
||||
font_size: 14
|
||||
text: "Start Date"
|
||||
size_hint_x: 0.42
|
||||
font_size: 13
|
||||
on_press: root.open_date_picker('start')
|
||||
|
||||
Spinner:
|
||||
id: start_hour_spinner
|
||||
Button:
|
||||
id: start_hour_button
|
||||
text: "00"
|
||||
values: [f"{i:02d}" for i in range(24)]
|
||||
size_hint_x: 0.2
|
||||
height: 25
|
||||
font_size: 14
|
||||
size_hint_x: 0.18
|
||||
font_size: 13
|
||||
on_press: root.open_hour_picker('start')
|
||||
|
||||
# New row: End date and hour
|
||||
BoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
height: 30
|
||||
spacing: 10
|
||||
|
||||
height: 38
|
||||
spacing: 8
|
||||
Label:
|
||||
text: "End Date"
|
||||
size_hint_x: 0.3
|
||||
font_size: 14
|
||||
|
||||
text: "End"
|
||||
font_size: 13
|
||||
size_hint_x: 0.18
|
||||
Button:
|
||||
id: end_date_picker_button
|
||||
text: "Select End Date"
|
||||
size_hint_x: 0.4
|
||||
height: 25
|
||||
font_size: 14
|
||||
text: "End Date"
|
||||
size_hint_x: 0.42
|
||||
font_size: 13
|
||||
on_press: root.open_date_picker('end')
|
||||
|
||||
Spinner:
|
||||
id: end_hour_spinner
|
||||
Button:
|
||||
id: end_hour_button
|
||||
text: "23"
|
||||
values: [f"{i:02d}" for i in range(24)]
|
||||
size_hint_x: 0.2
|
||||
height: 25
|
||||
font_size: 14
|
||||
size_hint_x: 0.18
|
||||
font_size: 13
|
||||
on_press: root.open_hour_picker('end')
|
||||
|
||||
# New row: Get trip server data button
|
||||
Button:
|
||||
id: get_trip_data_button
|
||||
text: "Get trip server data"
|
||||
size_hint: (1, None)
|
||||
height: 30
|
||||
font_size: 14
|
||||
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
|
||||
on_press: root.get_trip_server_data()
|
||||
# Responsive button row
|
||||
BoxLayout:
|
||||
id: trip_button_box
|
||||
orientation: 'horizontal' if self.width > 400 else 'vertical'
|
||||
size_hint_y: None
|
||||
height: 38 if self.width > 400 else 90
|
||||
spacing: 10
|
||||
Button:
|
||||
id: get_trip_data_button
|
||||
text: "Get trip data"
|
||||
font_size: 15
|
||||
background_color: 0.341, 0.235, 0.980, 1
|
||||
on_press: root.get_trip_server_data()
|
||||
|
||||
# Third row: Route info and save
|
||||
# Route info and save
|
||||
BoxLayout:
|
||||
orientation: "horizontal"
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
spacing: 10
|
||||
padding: 10
|
||||
height: 120
|
||||
spacing: 14
|
||||
padding: 14
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.15, 0.15, 0.15, 1
|
||||
@@ -341,41 +329,59 @@
|
||||
Label:
|
||||
id: points_count_label
|
||||
text: "Points: 0"
|
||||
font_size: 16
|
||||
size_hint_x: 0.2
|
||||
font_size: 15
|
||||
size_hint_y: None
|
||||
height: 24
|
||||
|
||||
Label:
|
||||
text: "Create Route"
|
||||
font_size: 16
|
||||
size_hint_x: 0.2
|
||||
BoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
height: 38
|
||||
spacing: 8
|
||||
Label:
|
||||
text: "Route:"
|
||||
font_size: 15
|
||||
size_hint_x: 0.25
|
||||
TextInput:
|
||||
id: route_name_input
|
||||
hint_text: "Route name"
|
||||
multiline: False
|
||||
font_size: 15
|
||||
size_hint_x: 0.5
|
||||
# Responsive save button row
|
||||
BoxLayout:
|
||||
id: save_button_box
|
||||
orientation: 'horizontal' if self.width > 400 else 'vertical'
|
||||
size_hint_x: 0.25
|
||||
size_hint_y: None
|
||||
height: 38 if self.width > 400 else 90
|
||||
spacing: 10
|
||||
Button:
|
||||
text: "Save"
|
||||
font_size: 15
|
||||
background_color: 0.008, 0.525, 0.290, 1
|
||||
on_press: root.save_route()
|
||||
|
||||
TextInput:
|
||||
id: route_name_input
|
||||
hint_text: "Enter route name"
|
||||
multiline: False
|
||||
size_hint_x: 0.4
|
||||
|
||||
Button:
|
||||
text: "Save"
|
||||
size_hint_x: 0.2
|
||||
background_color: 0.008, 0.525, 0.290, 1
|
||||
on_press: root.save_route()
|
||||
|
||||
# Fourth row: Result label
|
||||
# Result label
|
||||
Label:
|
||||
id: result_label
|
||||
text: "Welcome to the Home Screen!"
|
||||
font_size: 14 # Reduced font size
|
||||
size_hint: (1, 0.8)
|
||||
text: ""
|
||||
font_size: 15
|
||||
size_hint_y: None
|
||||
height: 28
|
||||
|
||||
# Fifth row: Back to Home button
|
||||
# Add empty space before the back button
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: 40
|
||||
|
||||
# Back button
|
||||
Button:
|
||||
text: "Back to Home"
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
size_hint_x: 0.8
|
||||
pos_hint: {"center_x": 0.5}
|
||||
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
|
||||
height: 48
|
||||
font_size: 15
|
||||
background_color: 0.341, 0.235, 0.980, 1
|
||||
on_press: app.root.current = "home"
|
||||
|
||||
<SettingsScreen>:
|
||||
@@ -480,4 +486,28 @@
|
||||
size_hint_x: 0.8
|
||||
pos_hint: {"center_x": 0.5}
|
||||
background_color: 0.341, 0.235, 0.980, 1 # Purple color (#573CFA)
|
||||
on_press: app.root.current = "home"
|
||||
|
||||
<CreateAnimationScreen>:
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
padding: 20
|
||||
spacing: 20
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.11, 0.10, 0.15, 1 # Same background as other screens
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
Label:
|
||||
text: "Create Animation Screen"
|
||||
font_size: 24
|
||||
color: 1, 1, 1, 1
|
||||
|
||||
Button:
|
||||
text: "Back to Home"
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
background_color: 0.341, 0.235, 0.980, 1
|
||||
on_press: app.root.current = "home"
|
||||
Reference in New Issue
Block a user