-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
79 lines (59 loc) · 2.39 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
67
68
69
70
71
72
73
74
75
76
77
78
from kivymd.app import MDApp
from kivy.lang import Builder
from kivmob import KivMob
from kivy.core.window import Window
from kivy.utils import platform
# Securing Debugable Apps
from kivy.clock import Clock
# Hiding Debugs
from kivymd.uix.dialog import MDDialog
from kivymd.uix.button import MDFlatButton,MDRaisedButton
if platform == 'macosx':
Window.size = (450, 750)
else:
pass
class OneApp(MDApp):
def __init__(self):
super().__init__()
self.theme_cls.primary_palette = 'BlueGray'
self.theme_cls.primary_style = 'Light'
self.title = 'Type To Write'
def show_dialog(self):
try:
self.dialog = MDDialog(title='LOGOUT', text='Are you sure to log out',
size_hint=(0.5, 1),
buttons=[MDFlatButton(text='Close', on_release=self.close_dialog)
, MDRaisedButton(text='Sign Out', on_release=self.sign_out)])
self.dialog.open()
except:
pass
def close_dialog(self,*args):
self.dialog.dismiss()
def sign_out(self, obj):
self.screen.ids.firebaseloginscreen.log_out()
self.screen.current = "firebaseloginscreen"
self.dialog.dismiss()
def loading_screen(self,*args):
self.screen.ids.firebaseloginscreen.display_loading_screen()
Clock.schedule_once(self.hide_screen, 0.3)
def hide_screen(self,*args):
self.screen.ids.firebaseloginscreen.hide_loading_screen()
def build(self):
# Importing config.Config class from config.py
# Put Banner Ads
self.ads = KivMob('ca-app-pub-1818238534900904~2025018602')
# Ads ID
self.ads.new_banner('ca-app-pub-1818238534900904/4048546717', top_pos=False)
# Requesting New Ads
self.ads.request_banner()
self.ads.show_banner()
self.screen = Builder.load_file('main.kv')
self.screen.ids.firebaseloginscreen.web_api_key = "AIzaSyBmrGpiwimYZ-HT_BSesv4gMjuPJcG3omM"
self.screen.ids.firebaseloginscreen.debug = False
self.screen.ids.firebaseloginscreen.remember_user = True
self.screen.ids.firebaseloginscreen.require_email_verification = True
self.screen.ids.typetowritescreen.ids.background = 'background.jpg'
return self.screen
# Showing Ads To The Screen
if __name__ == '__main__':
OneApp().run()