You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
2.8 KiB

<SignInScreen>:
FloatLayout:
MDToolbar:
pos_hint: {"top": 1}
left_action_items: [['chevron-left', lambda x: root.go_back()]]
RoundedCard:
pos_hint: {"center_y": .5, "center_x": .5}
orientation: "vertical"
size_hint: 0.5, 0.5
md_bg_color: self.theme_cls.primary_color
padding: "10sp"
RoundedCard:
orientation: "vertical"
size_hint_y: 2
padding: "20sp"
DetailBox:
id: email
size_hint_x: .9
pos_hint: {"center_x": .5, "top": .7}
hint_text: "Email"
DetailBox:
id: password
size_hint_x: .9
pos_hint: {"center_x": .5, "top": .575}
hint_text: "Password"
password: True
disabled: True if not email.text else False
MDBoxLayout:
orientation: "horizontal"
spacing: "5sp"
Widget:
size_hint_y: 3
MyButton:
text: "Reset Password"
disabled: True if not email.text else False
md_bg_color: app.theme_cls.primary_light
theme_text_color: "Custom"
text_color: self.theme_cls.primary_text(hue=self.theme_cls.primary_light_hue)
on_release:
# Need to refer to the FirebaseLoginScreen
root.parent.parent.reset_password(email.text)
sign_up_button.disabled = True
root.parent.parent.display_loading_screen()
MyButton:
id: sign_up_button
text: "Sign up"
disabled: True if not email.text else False
md_bg_color: app.theme_cls.primary_light
theme_text_color: "Custom"
text_color: self.theme_cls.primary_text(hue=self.theme_cls.primary_light_hue)
on_release:
root.parent.current = "sign_up_screen"
root.parent.parent.ids.sign_up_screen.ids.email.text = email.text
root.parent.parent.ids.sign_up_screen.ids.password.text = password.text
MyButton:
text: "Sign In"
disabled: True if not password.text else False
on_release:
# Need to refer to the FirebaseLoginScreen
root.parent.parent.sign_in(email.text, password.text)
sign_up_button.disabled = True
root.parent.parent.display_loading_screen()