-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
67 lines (57 loc) · 2.01 KB
/
main.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from kivy import platform
from kivy.app import App
from kivy.core.window import Window
from kivy.loader import Loader
from kivy.properties import ObjectProperty
from components.bar import win_md_bnb
from components.transition import SharedAxisTransition
from ui.theme import ThemeManager
from components.factory_register import register_factory
from features.screenmanager import AppScreenManager
from kivy.lang import Builder
Loader.error_image = "assets/images/transparent.png"
Loader.loading_image = "assets/images/transparent.png"
Window.softinput_mode = "below_target"
Builder.load_file("imports.kv")
register_factory()
class ChollofApp(App):
theme_cls = ObjectProperty()
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.theme_cls = ThemeManager()
# self.theme_cls.theme_style = "Dark"
def build(self):
sm = AppScreenManager(transition=SharedAxisTransition())
if platform == "android":
from sjfirebase.tools.mixin import UserMixin
if user := UserMixin().get_current_user():
user.reload()
sm.current = "restaurant screen"
return sm
sm.current = "login screen"
return sm
def on_start(self):
win_md_bnb.create_bnb(
tabs=[
{
"icon": "storefront",
"icon_variant": "storefront-outline",
"text": "Restaurants",
"active": True,
},
# {
# "icon": "bike-fast",
# "icon_variant": "bike-fast",
# "text": "Order",
# "active": False,
# "on_release": lambda _: self.add_screen("order screen")
# },
{
"icon": "cog",
"icon_variant": "cog-outline",
"text": "Settings",
}
],
)
if __name__ == '__main__':
ChollofApp().run()