Add kivy state file

This commit is contained in:
shekhar-cis 2022-04-29 19:06:04 +05:30
parent b2fd30c338
commit fda5f94f7d
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,36 @@
# pylint: disable=too-many-instance-attributes, too-few-public-methods
"""
Kivy State variables are assigned here, they are separated from state.py
=================================
"""
class KivyStateVariables(object):
"""This Class hold all the kivy state variables"""
def __init__(self):
self.association = ''
self.navinstance = None
self.mail_id = 0
self.myAddressObj = None
self.detailPageType = None
self.ackdata = None
self.status = None
self.screen_density = None
self.msg_counter_objs = None
self.check_sent_acc = None
self.sent_count = 0
self.inbox_count = 0
self.trash_count = 0
self.draft_count = 0
self.all_count = 0
self.searcing_text = ''
self.search_screen = ''
self.send_draft_mail = None
self.is_allmail = False
self.in_composer = False
self.availabe_credit = 0
self.in_sent_method = False
self.in_search_mode = False
self.imageDir = None

View File

@ -61,6 +61,9 @@ from bitmessagekivy.baseclass.common import toast
from qr_scanner.zbarcam import ZBarCam from qr_scanner.zbarcam import ZBarCam
from pyzbar.pyzbar import ZBarSymbol from pyzbar.pyzbar import ZBarSymbol
# import pdb; pdb.set_trace()
from bitmessagekivy.kivy_state import KivyStateVariables
if platform != "android": if platform != "android":
from kivy.config import Config from kivy.config import Config
Config.set("input", "mouse", "mouse, multitouch_on_demand") Config.set("input", "mouse", "mouse, multitouch_on_demand")
@ -208,8 +211,12 @@ class CustomSpinner(Spinner):
class NavigateApp(MDApp): class NavigateApp(MDApp):
"""Navigation Layout of class""" """Navigation Layout of class"""
# pylint: disable=too-many-public-methods,inconsistent-return-statements # pylint: disable=too-many-public-methods,inconsistent-return-statements
kivyy = KivyStateVariables()
# theme_cls = ThemeManager() # theme_cls = ThemeManager()
def __init__(self):
super(NavigateApp, self).__init__()
self.kivy_state_obj = KivyStateVariables()
previous_date = ObjectProperty() previous_date = ObjectProperty()
obj_1 = ObjectProperty() obj_1 = ObjectProperty()
variable_1 = ListProperty(addr for addr in BMConfigParser().addresses() variable_1 = ListProperty(addr for addr in BMConfigParser().addresses()