-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpeningScreen.py
More file actions
40 lines (30 loc) · 1.18 KB
/
OpeningScreen.py
File metadata and controls
40 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from kivy.clock import Clock
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.image import Image
from kivymd.app import MDApp
from TimeScreen import TimeScreen
from Shavtzak import Shavtzak
class ShavtzakApp(MDApp):
def build(self):
# Create a ScreenManager
screen_manager = ScreenManager()
# Create the opening screen
opening_screen = Screen(name="opening_screen")
screen_manager.add_widget(opening_screen)
# Add logo to the opening screen
opening_screen.add_widget(Image(
source="logo.jpeg",
pos_hint={"center_x": 0.5, "center_y": 0.55}
))
# Create the time screen
time_screen = TimeScreen(screen_manager, name="time_screen")
screen_manager.add_widget(time_screen)
# Schedule a switch to the time screen after 1 second
Clock.schedule_once(lambda dt: self.switch_screen(screen_manager, "time_screen"), 3)
return screen_manager
def switch_screen(self, screen_manager, screen_name):
# Switch to the specified screen
screen_manager.current = screen_name
# Run the app
if __name__ == '__main__':
ShavtzakApp().run()