update kivymd 0.104.1 to 0.104.2.dev0

This commit is contained in:
navjot 2021-03-16 15:13:11 +05:30
parent d62d464b61
commit a255840506
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
6 changed files with 46 additions and 80 deletions

View File

@ -41,11 +41,12 @@
_txt_right_pad: dp(70) _txt_right_pad: dp(70)
font_size: '11sp' font_size: '11sp'
MDChip: MDChip:
size_hint: (.16 if app.app_platform == 'android' else .07 , None) size_hint: (.16 if app.app_platform == 'android' else .08 , None)
label: app.tr._(root.page_type) text: app.tr._(root.page_type)
icon: '' icon: ''
text_color: (1,1,1,1)
pos_hint: {'center_x': .91 if app.app_platform == 'android' else .95, 'center_y': .3} pos_hint: {'center_x': .91 if app.app_platform == 'android' else .95, 'center_y': .3}
radius: 8 radius: [8]
height: self.parent.height/4 height: self.parent.height/4
AvatarSampleWidget: AvatarSampleWidget:
source: root.avatarImg source: root.avatarImg

View File

@ -96,7 +96,7 @@
id: myadd_popup id: myadd_popup
size_hint_y: None size_hint_y: None
spacing:dp(25) spacing:dp(25)
height: dp(1.2*(myaddr_label.height)) # height: dp(1.2*(myaddr_label.height))
orientation: 'vertical' orientation: 'vertical'
MDLabel: MDLabel:
id: myaddr_label id: myaddr_label
@ -171,7 +171,7 @@
<AppClosingPopup>: <AppClosingPopup>:
id: closing_popup id: closing_popup
size_hint : (None,None) 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) 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' background: app.image_path + '/popup.jpeg'
auto_dismiss: False auto_dismiss: False

View File

@ -204,18 +204,11 @@
# halign: 'right' # halign: 'right'
bold: True bold: True
MDDropDownItem: MDDropDownItem:
id: drop_item id: dropdown_item
# pos_hint: {'center_x': .5, 'center_y': .5} text: "System Setting"
text: 'System Setting' # pos_hint: {"center_x": .5, "center_y": .6}
# current_item: "Item 0"
on_release: root.menu.open() 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: BoxLayout:
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'

View File

@ -100,8 +100,8 @@
x: root.parent.x x: root.parent.x
pos_hint: {"top": 1} pos_hint: {"top": 1}
Image: Image:
#source: './images/drawer_logo1.png' # source: './images/drawer_logo1.png'
source: app.get_default_logo() # source: app.get_default_logo()
ScrollView: ScrollView:
id: scroll_y id: scroll_y
@ -173,7 +173,7 @@
NavigationItem: NavigationItem:
id: allmail_cnt id: allmail_cnt
text: app.tr._('All Mails') text: app.tr._('All Mails')
icon: 'contact-mail' icon: 'mailbox'
divider: None divider: None
on_release: app.root.ids.scr_mngr.current = 'allmails' on_release: app.root.ids.scr_mngr.current = 'allmails'
on_release: root.parent.set_state() on_release: root.parent.set_state()
@ -196,7 +196,7 @@
on_release: root.parent.set_state() on_release: root.parent.set_state()
NavigationItem: NavigationItem:
text: app.tr._('Settings') text: app.tr._('Settings')
icon: 'settings' icon: 'application-settings'
divider: None divider: None
on_release: app.root.ids.scr_mngr.current = 'set' on_release: app.root.ids.scr_mngr.current = 'set'
on_release: root.parent.set_state() on_release: root.parent.set_state()
@ -232,7 +232,7 @@
on_release: app.root.ids.scr_mngr.current = 'myaddress' on_release: app.root.ids.scr_mngr.current = 'myaddress'
on_release: root.parent.set_state() on_release: root.parent.set_state()
NavigationLayout: MDNavigationLayout:
id: nav_layout id: nav_layout
MDToolbar: MDToolbar:

View File

@ -25,6 +25,10 @@ from debug import logger
from functools import partial from functools import partial
from helper_sql import sqlExecute, sqlQuery from helper_sql import sqlExecute, sqlQuery
from kivymd.app import MDApp 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.clock import Clock
from kivy.core.clipboard import Clipboard from kivy.core.clipboard import Clipboard
from kivy.core.window import Window from kivy.core.window import Window
@ -181,15 +185,16 @@ def chipTag(text):
"""This method is used for showing chip tag""" """This method is used for showing chip tag"""
obj = MDChip() obj = MDChip()
# obj.size_hint = (None, None) # obj.size_hint = (None, None)
obj.size_hint = (0.16 if platform == "android" else 0.07, None) obj.size_hint = (0.16 if platform == "android" else 0.08, None)
obj.label = text obj.text = text
obj.icon = "" obj.icon = ""
obj.pos_hint = { obj.pos_hint = {
"center_x": 0.91 if platform == "android" else 0.94, "center_x": 0.91 if platform == "android" else 0.94,
"center_y": 0.3 "center_y": 0.3
} }
obj.height = dp(18) obj.height = dp(18)
obj.radius = 8 obj.text_color = (1,1,1,1)
obj.radius =[8]
return obj return obj
@ -580,7 +585,7 @@ class MyAddress(Screen):
obj = MyaddDetailPopup() obj = MyaddDetailPopup()
self.address_label = obj.address_label = label self.address_label = obj.address_label = label
self.text_address = obj.address = fromaddress self.text_address = obj.address = fromaddress
width = .9 if platform == 'android' else .8 width = .9 if platform == 'android' else .6
self.myadddetail_popup = MDDialog( self.myadddetail_popup = MDDialog(
type="custom", type="custom",
size_hint=(width, .25), size_hint=(width, .25),
@ -1871,26 +1876,20 @@ class Setting(Screen):
state.kivyapp.tr = Lang(self.newlocale) state.kivyapp.tr = Lang(self.newlocale)
menu_items = [{"text": f"{i}"} for i in self.languages.values()] menu_items = [{"text": f"{i}"} for i in self.languages.values()]
self.menu = MDDropdownMenu( self.menu = MDDropdownMenu(
caller=self, caller=self.ids.dropdown_item,
items=menu_items, items=menu_items,
position="auto", position="auto",
callback=self.set_item,
width_mult=3.5, width_mult=3.5,
# use_icon_item=False,
) )
self.menu.bind(on_release=self.set_item)
def set_caller(self): def set_item(self, instance_menu, instance_menu_item):
"""set_caller module""" # import pdb;pdb.set_trace()
self.menu.caller = self.ids.drop_item self.ids.dropdown_item.set_item(instance_menu_item.text)
self.menu.target_height = 150 instance_menu.dismiss()
def set_item(self, instance):
"""set_item module for menu selection"""
self.ids.drop_item.set_item(instance.text)
self.menu.dismiss()
def change_language(self): 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(): for k, v in self.languages.items():
if v == lang: if v == lang:
BMConfigParser().set('bitmessagesettings', 'userlocale', k) BMConfigParser().set('bitmessagesettings', 'userlocale', k)
@ -1944,10 +1943,8 @@ class NavigateApp(MDApp):
kivyuisignaler.release() kivyuisignaler.release()
super(NavigateApp, self).run() super(NavigateApp, self).run()
# @staticmethod @staticmethod
def clickNavDrawer(self): def clickNavDrawer():
# import tempfile
# state.appdata = tempfile.gettempdir()
state.kivyapp.root.ids.nav_drawer.set_state('toggle') state.kivyapp.root.ids.nav_drawer.set_state('toggle')
@staticmethod @staticmethod
@ -2030,20 +2027,19 @@ class NavigateApp(MDApp):
self.add_popup = MDDialog( self.add_popup = MDDialog(
title='add contact\'s', title='add contact\'s',
type="custom", type="custom",
size_hint=(width, .25), size_hint=(width, .23),
content_cls=GrashofPopup(), content_cls=GrashofPopup(),
buttons=[ buttons=[
MDRaisedButton( MDRaisedButton(
text="Save", text="Save",
text_color=self.theme_cls.primary_color,
on_release=self.savecontact, on_release=self.savecontact,
), ),
MDRaisedButton( MDRaisedButton(
text="Cancel", text_color=self.theme_cls.primary_color, text="Cancel",
on_release=self.close_pop, on_release=self.close_pop,
), ),
MDRaisedButton( MDRaisedButton(
text="Scan QR code", text_color=self.theme_cls.primary_color, text="Scan QR code",
on_release=self.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 = ( instance.parent.parent.parent.parent.parent.ids.top_box.children[0].texture = (
img.texture) img.texture)
return first_addr return first_addr
instance.parent.parent.parent.parent.parent.ids.top_box.children[0].source = (
state.imageDir + '/drawer_logo1.png')
return 'Select Address' 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 @staticmethod
def addressexist(): def addressexist():
"""Checking address existence""" """Checking address existence"""
@ -2589,8 +2560,10 @@ class NavigateApp(MDApp):
newImg = PilImage.open(path).resize((300, 300)) newImg = PilImage.open(path).resize((300, 300))
if platform == 'android': if platform == 'android':
android_path = os.path.join( android_path = os.path.join(
os.environ['ANDROID_PRIVATE'] + '/app/') os.environ['ANDROID_PRIVATE'] + '/app' + '/images' + '/kivy/')
newImg.save('{1}/images/kivy/default_identicon/{0}.png'.format( 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)) state.association, android_path))
else: else:
if not os.path.exists(state.imageDir + '/default_identicon/'): if not os.path.exists(state.imageDir + '/default_identicon/'):
@ -3519,7 +3492,7 @@ class SenderDetailPopup(Popup):
time_obj = datetime.fromtimestamp(int(timeinseconds)) time_obj = datetime.fromtimestamp(int(timeinseconds))
self.time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") self.time_tag = time_obj.strftime("%d %b %Y, %I:%M %p")
device_type = 2 if platform == 'android' else 1.5 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: if len(to_addr) > 3:
self.height = 0 self.height = 0
self.height = pop_height self.height = pop_height

View File

@ -41,15 +41,14 @@ requirements =
android, android,
openssl, openssl,
sqlite3, sqlite3,
kivy==1.11.1, kivy,
pyjnius==1.2.1, pyjnius==1.2.1,
libiconv, libiconv,
libzbar, libzbar,
pillow, pillow,
bitmsghash, bitmsghash,
#git+https://github.com/surbhicis/KivyMD-1.git, #git+https://github.com/navjotcis/KivyMD#egg=kivymd,
#git+https://github.com/surbhicis/KivyMD-1#egg=kivymd, kivymd,
git+https://github.com/navjotcis/KivyMD#egg=kivymd,
kivy-garden, kivy-garden,
qrcode, qrcode,
msgpack msgpack