From a2558405065ef62d99353e696e5647dc157241b0 Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 16 Mar 2021 15:13:11 +0530 Subject: [PATCH] update kivymd 0.104.1 to 0.104.2.dev0 --- src/bitmessagekivy/kv/maildetail.kv | 7 +-- src/bitmessagekivy/kv/popup.kv | 4 +- src/bitmessagekivy/kv/settings.kv | 15 ++---- src/bitmessagekivy/main.kv | 10 ++-- src/bitmessagekivy/mpybit.py | 83 ++++++++++------------------- src/buildozer.spec | 7 ++- 6 files changed, 46 insertions(+), 80 deletions(-) diff --git a/src/bitmessagekivy/kv/maildetail.kv b/src/bitmessagekivy/kv/maildetail.kv index 72473f94..07851e8e 100644 --- a/src/bitmessagekivy/kv/maildetail.kv +++ b/src/bitmessagekivy/kv/maildetail.kv @@ -41,11 +41,12 @@ _txt_right_pad: dp(70) font_size: '11sp' MDChip: - size_hint: (.16 if app.app_platform == 'android' else .07 , None) - label: app.tr._(root.page_type) + size_hint: (.16 if app.app_platform == 'android' else .08 , None) + text: app.tr._(root.page_type) icon: '' + text_color: (1,1,1,1) pos_hint: {'center_x': .91 if app.app_platform == 'android' else .95, 'center_y': .3} - radius: 8 + radius: [8] height: self.parent.height/4 AvatarSampleWidget: source: root.avatarImg diff --git a/src/bitmessagekivy/kv/popup.kv b/src/bitmessagekivy/kv/popup.kv index 3a52afb8..1a713de6 100644 --- a/src/bitmessagekivy/kv/popup.kv +++ b/src/bitmessagekivy/kv/popup.kv @@ -96,7 +96,7 @@ id: myadd_popup size_hint_y: None spacing:dp(25) - height: dp(1.2*(myaddr_label.height)) + # height: dp(1.2*(myaddr_label.height)) orientation: 'vertical' MDLabel: id: myaddr_label @@ -171,7 +171,7 @@ : id: closing_popup size_hint : (None,None) - height: 1.3*(popup_label.height+ my_add_btn.children[0].height) + height: 1.4*(popup_label.height+ my_add_btn.children[0].height) width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4) background: app.image_path + '/popup.jpeg' auto_dismiss: False diff --git a/src/bitmessagekivy/kv/settings.kv b/src/bitmessagekivy/kv/settings.kv index 5e5ea185..193f5db5 100644 --- a/src/bitmessagekivy/kv/settings.kv +++ b/src/bitmessagekivy/kv/settings.kv @@ -204,18 +204,11 @@ # halign: 'right' bold: True MDDropDownItem: - id: drop_item - # pos_hint: {'center_x': .5, 'center_y': .5} - text: 'System Setting' + id: dropdown_item + text: "System Setting" + # pos_hint: {"center_x": .5, "center_y": .6} + # current_item: "Item 0" on_release: root.menu.open() - on_press: root.set_caller() - # MDDropDownItem: - # id: dropdown_item - # text: 'italiano' - # dropdown_max_height: 150 - # dropdown_bg: [1, 1, 1, 1] - # # pos_hint: {'center_x': 0.5, 'center_y': 0} - # items: [f"{i}" for i in ['System Setting','U.S. English','italiano','Esperanto','dansk','Deutsch','Pirate English','francais','Nederlands','norsk bokmal','polski','portugues europeu']] BoxLayout: spacing:5 orientation: 'horizontal' diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index 3960b38c..95e98a2b 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -100,8 +100,8 @@ x: root.parent.x pos_hint: {"top": 1} Image: - #source: './images/drawer_logo1.png' - source: app.get_default_logo() + # source: './images/drawer_logo1.png' + # source: app.get_default_logo() ScrollView: id: scroll_y @@ -173,7 +173,7 @@ NavigationItem: id: allmail_cnt text: app.tr._('All Mails') - icon: 'contact-mail' + icon: 'mailbox' divider: None on_release: app.root.ids.scr_mngr.current = 'allmails' on_release: root.parent.set_state() @@ -196,7 +196,7 @@ on_release: root.parent.set_state() NavigationItem: text: app.tr._('Settings') - icon: 'settings' + icon: 'application-settings' divider: None on_release: app.root.ids.scr_mngr.current = 'set' on_release: root.parent.set_state() @@ -232,7 +232,7 @@ on_release: app.root.ids.scr_mngr.current = 'myaddress' on_release: root.parent.set_state() -NavigationLayout: +MDNavigationLayout: id: nav_layout MDToolbar: diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index f52e4f05..766f8546 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -25,6 +25,10 @@ from debug import logger from functools import partial from helper_sql import sqlExecute, sqlQuery from kivymd.app import MDApp +import kivy +import kivymd +print('kivy version......................................', kivy.__version__) +print('kivymd version......................................', kivymd.__version__) from kivy.clock import Clock from kivy.core.clipboard import Clipboard from kivy.core.window import Window @@ -181,15 +185,16 @@ def chipTag(text): """This method is used for showing chip tag""" obj = MDChip() # obj.size_hint = (None, None) - obj.size_hint = (0.16 if platform == "android" else 0.07, None) - obj.label = text + obj.size_hint = (0.16 if platform == "android" else 0.08, None) + obj.text = text obj.icon = "" obj.pos_hint = { "center_x": 0.91 if platform == "android" else 0.94, "center_y": 0.3 } obj.height = dp(18) - obj.radius = 8 + obj.text_color = (1,1,1,1) + obj.radius =[8] return obj @@ -580,7 +585,7 @@ class MyAddress(Screen): obj = MyaddDetailPopup() self.address_label = obj.address_label = label self.text_address = obj.address = fromaddress - width = .9 if platform == 'android' else .8 + width = .9 if platform == 'android' else .6 self.myadddetail_popup = MDDialog( type="custom", size_hint=(width, .25), @@ -1871,26 +1876,20 @@ class Setting(Screen): state.kivyapp.tr = Lang(self.newlocale) menu_items = [{"text": f"{i}"} for i in self.languages.values()] self.menu = MDDropdownMenu( - caller=self, + caller=self.ids.dropdown_item, items=menu_items, position="auto", - callback=self.set_item, width_mult=3.5, - # use_icon_item=False, ) + self.menu.bind(on_release=self.set_item) - def set_caller(self): - """set_caller module""" - self.menu.caller = self.ids.drop_item - self.menu.target_height = 150 - - def set_item(self, instance): - """set_item module for menu selection""" - self.ids.drop_item.set_item(instance.text) - self.menu.dismiss() + def set_item(self, instance_menu, instance_menu_item): + # import pdb;pdb.set_trace() + self.ids.dropdown_item.set_item(instance_menu_item.text) + instance_menu.dismiss() def change_language(self): - lang = self.ids.drop_item.current_item + lang = self.ids.dropdown_item.current_item for k, v in self.languages.items(): if v == lang: BMConfigParser().set('bitmessagesettings', 'userlocale', k) @@ -1944,10 +1943,8 @@ class NavigateApp(MDApp): kivyuisignaler.release() super(NavigateApp, self).run() - # @staticmethod - def clickNavDrawer(self): - # import tempfile - # state.appdata = tempfile.gettempdir() + @staticmethod + def clickNavDrawer(): state.kivyapp.root.ids.nav_drawer.set_state('toggle') @staticmethod @@ -2030,20 +2027,19 @@ class NavigateApp(MDApp): self.add_popup = MDDialog( title='add contact\'s', type="custom", - size_hint=(width, .25), + size_hint=(width, .23), content_cls=GrashofPopup(), buttons=[ MDRaisedButton( text="Save", - text_color=self.theme_cls.primary_color, on_release=self.savecontact, ), MDRaisedButton( - text="Cancel", text_color=self.theme_cls.primary_color, + text="Cancel", on_release=self.close_pop, ), MDRaisedButton( - text="Scan QR code", text_color=self.theme_cls.primary_color, + text="Scan QR code", on_release=self.scan_qr_code, ), ], @@ -2136,35 +2132,10 @@ class NavigateApp(MDApp): instance.parent.parent.parent.parent.parent.ids.top_box.children[0].texture = ( img.texture) return first_addr + instance.parent.parent.parent.parent.parent.ids.top_box.children[0].source = ( + state.imageDir + '/drawer_logo1.png') return 'Select Address' - @staticmethod - def createFolder(directory): - """Create directory when app starts""" - try: - if not os.path.exists(directory): - os.makedirs(directory) - except OSError: - print('Error: Creating directory. ' + directory) - - @staticmethod - def get_default_image(): - """Getting default image on address""" - if BMConfigParser().addresses(): - return state.imageDir + '/default_identicon/{}.png'.format( - BMConfigParser().addresses()[0]) - return state.imageDir + '/no_identicons.png' - - @staticmethod - def get_default_logo(): - """Getting default logo image""" - if BMConfigParser().addresses(): - first_addr = BMConfigParser().addresses()[0] - if BMConfigParser().get(str(first_addr), 'enabled') == 'true': - return state.imageDir + '/default_identicon/{}.png'.format( - first_addr) - return state.imageDir + '/drawer_logo1.png' - @staticmethod def addressexist(): """Checking address existence""" @@ -2589,8 +2560,10 @@ class NavigateApp(MDApp): newImg = PilImage.open(path).resize((300, 300)) if platform == 'android': android_path = os.path.join( - os.environ['ANDROID_PRIVATE'] + '/app/') - newImg.save('{1}/images/kivy/default_identicon/{0}.png'.format( + os.environ['ANDROID_PRIVATE'] + '/app' + '/images' + '/kivy/') + if not os.path.exists(android_path + '/default_identicon/'): + os.makedirs(android_path + '/default_identicon/') + newImg.save('{1}/default_identicon/{0}.png'.format( state.association, android_path)) else: if not os.path.exists(state.imageDir + '/default_identicon/'): @@ -3519,7 +3492,7 @@ class SenderDetailPopup(Popup): time_obj = datetime.fromtimestamp(int(timeinseconds)) self.time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") device_type = 2 if platform == 'android' else 1.5 - pop_height = device_type * (self.ids.sd_label.height + self.ids.dismiss_btn.height) + pop_height = 1.2 * device_type * (self.ids.sd_label.height + self.ids.dismiss_btn.height) if len(to_addr) > 3: self.height = 0 self.height = pop_height diff --git a/src/buildozer.spec b/src/buildozer.spec index 6f003918..22631799 100644 --- a/src/buildozer.spec +++ b/src/buildozer.spec @@ -41,15 +41,14 @@ requirements = android, openssl, sqlite3, - kivy==1.11.1, + kivy, pyjnius==1.2.1, libiconv, libzbar, pillow, bitmsghash, - #git+https://github.com/surbhicis/KivyMD-1.git, - #git+https://github.com/surbhicis/KivyMD-1#egg=kivymd, - git+https://github.com/navjotcis/KivyMD#egg=kivymd, + #git+https://github.com/navjotcis/KivyMD#egg=kivymd, + kivymd, kivy-garden, qrcode, msgpack