Merge pull request #36 from cis-navjot-g/newwork

worked on android application popup responsive functionality
This commit is contained in:
cis-navjot-g 2019-09-24 20:53:53 +05:30 committed by GitHub
commit 0d9b147ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 51 deletions

View File

@ -72,9 +72,9 @@
on_text:app.getCurrentAccountData(self.text) on_text:app.getCurrentAccountData(self.text)
Image: Image:
source: app.get_default_image() source: app.get_default_image()
x: self.width/4-2 x: self.width/6
y: self.parent.y + self.parent.height/2 - self.height + 14 y: self.parent.y + self.parent.height/4
size: 28, 28 size: self.parent.height/2, self.parent.height/2
ArrowImg: ArrowImg:
NavigationDrawerIconButton: NavigationDrawerIconButton:
id: inbox_cnt id: inbox_cnt
@ -821,11 +821,13 @@ NavigationLayout:
<GrashofPopup>: <GrashofPopup>:
id: popup id: popup
size_hint : (None,None)
height: 2*(label.height + address.height) + 10
width :app.window_size[0] - app.window_size[0]/10
title: 'add contact\'s' title: 'add contact\'s'
background: './images/popup.jpeg' background: './images/popup.jpeg'
title_size: sp(20) title_size: sp(20)
title_color: 0.4, 0.3765, 0.3451, 1 title_color: 0.4, 0.3765, 0.3451, 1
size_hint: 1, 1
auto_dismiss: False auto_dismiss: False
separator_color: 0.3529, 0.3922, 0.102, 0.7 separator_color: 0.3529, 0.3922, 0.102, 0.7
BoxLayout: BoxLayout:
@ -1050,19 +1052,23 @@ NavigationLayout:
<MyaddDetailPopup>: <MyaddDetailPopup>:
id: myadd_popup id: myadd_popup
size_hint : (None,None)
height: 4.5*(myaddr_label.height+ my_add_btn.children[0].height)
width :app.window_size[0] - app.window_size[0]/10
background: './images/popup.jpeg' background: './images/popup.jpeg'
separator_height: 0
auto_dismiss: False auto_dismiss: False
separator_height: 0
BoxLayout: BoxLayout:
id: myadd_popup_box
size_hint_y: None size_hint_y: None
spacing:dp(70) spacing:dp(70)
id: myadd_popup_box
orientation: 'vertical' orientation: 'vertical'
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
spacing:dp(25) spacing:dp(25)
MDLabel: MDLabel:
id: myaddr_label
font_style: 'Title' font_style: 'Title'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Label" text: "Label"
@ -1087,6 +1093,7 @@ NavigationLayout:
font_size: '15sp' font_size: '15sp'
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
id: my_add_btn
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'
MDRaisedButton: MDRaisedButton:
@ -1125,6 +1132,9 @@ NavigationLayout:
<AddbookDetailPopup>: <AddbookDetailPopup>:
id: addbook_popup id: addbook_popup
size_hint : (None,None)
height: 4*(add_label.height)
width :app.window_size[0] - app.window_size[0]/10
background: './images/popup.jpeg' background: './images/popup.jpeg'
separator_height: 0 separator_height: 0
auto_dismiss: False auto_dismiss: False
@ -1165,6 +1175,7 @@ NavigationLayout:
font_size: '15sp' font_size: '15sp'
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
id: addbook_btn
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'
MDRaisedButton: MDRaisedButton:

View File

@ -1036,14 +1036,6 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
state.association = text state.association = text
self.root.ids.sc1.clear_widgets() self.root.ids.sc1.clear_widgets()
self.root.ids.sc1.add_widget(Inbox()) self.root.ids.sc1.add_widget(Inbox())
# self.root.ids.sc4.clear_widgets()
# self.root.ids.sc5.clear_widgets()
# self.root.ids.sc16.clear_widgets()
# self.root.ids.sc17.clear_widgets()
# self.root.ids.sc4.add_widget(Sent())
# self.root.ids.sc5.add_widget(Trash())
# self.root.ids.sc16.add_widget(Draft())
# self.root.ids.sc17.add_widget(Allmails())
self.root.ids.scr_mngr.current = 'inbox' self.root.ids.scr_mngr.current = 'inbox'
msg_counter_objs = \ msg_counter_objs = \
@ -1091,7 +1083,12 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
if BMConfigParser().addresses(): if BMConfigParser().addresses():
img = identiconGeneration.generate(BMConfigParser().addresses()[0]) img = identiconGeneration.generate(BMConfigParser().addresses()[0])
self.createFolder('./images/default_identicon/') self.createFolder('./images/default_identicon/')
img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])) if platform == 'android':
# android_path = os.path.expanduser("~/user/0/org.test.bitapp/files/app/")
android_path = os.path.join(os.environ['ANDROID_PRIVATE'] + '/app/')
img.texture.save('{1}/images/default_identicon/{0}.png'.format(BMConfigParser().addresses()[0], android_path))
else:
img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0]))
return BMConfigParser().addresses()[0] return BMConfigParser().addresses()[0]
return 'Select Address' return 'Select Address'
@ -1125,8 +1122,6 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
self.root.ids.scr_mngr.current = 'sent'\ self.root.ids.scr_mngr.current = 'sent'\
if state.detailPageType == 'sent' else 'inbox' \ if state.detailPageType == 'sent' else 'inbox' \
if state.detailPageType == 'inbox' else 'draft' if state.detailPageType == 'inbox' else 'draft'
# if state.detailPageType in ['sent', 'inbox']:
# self.add_search_bar()
self.back_press() self.back_press()
elif self.root.ids.scr_mngr.current == "create": elif self.root.ids.scr_mngr.current == "create":
composer_objs = self.root composer_objs = self.root
@ -1309,13 +1304,6 @@ class GrashofPopup(Popup):
def __init__(self, **kwargs): def __init__(self, **kwargs):
"""Grash of pop screen settings.""" """Grash of pop screen settings."""
super(GrashofPopup, self).__init__(**kwargs) super(GrashofPopup, self).__init__(**kwargs)
print("sssssssssssssssssssiiiiiiiiiiiiiiizzzzzzzzzzeeeeee...............", state.screen_density)
if state.screen_density[0] <= 720:
self.size_hint_y = 0.4
self.size_hint_x = 0.9
else:
self.size_hint_y = 0.42
self.size_hint_x = 0.7
def savecontact(self): def savecontact(self):
"""Method is used for Saving Contacts.""" """Method is used for Saving Contacts."""
@ -1497,9 +1485,6 @@ class MailDetail(Screen):
sqlExecute( sqlExecute(
"UPDATE inbox SET folder = 'trash' WHERE \ "UPDATE inbox SET folder = 'trash' WHERE \
received = {};".format(state.sentMailTime)) received = {};".format(state.sentMailTime))
# msg_count_objs.inbox_cnt.badge_text = str(
# int(state.inbox_count) - 1)
# state.inbox_count = str(int(state.inbox_count) - 1)
self.parent.screens[0].clear_widgets() self.parent.screens[0].clear_widgets()
self.parent.screens[0].add_widget(Inbox()) self.parent.screens[0].add_widget(Inbox())
elif state.detailPageType == 'draft': elif state.detailPageType == 'draft':
@ -1574,12 +1559,6 @@ class MyaddDetailPopup(Popup):
def __init__(self, **kwargs): def __init__(self, **kwargs):
"""My Address Details screen setting.""" """My Address Details screen setting."""
super(MyaddDetailPopup, self).__init__(**kwargs) super(MyaddDetailPopup, self).__init__(**kwargs)
if state.screen_density[0] <= 720:
self.size_hint_y = 0.32
self.size_hint_x = 0.9
else:
self.size_hint_y = 0.32
self.size_hint_x = 0.7
def set_address(self, address, label): def set_address(self, address, label):
"""Getting address for displaying details on popup.""" """Getting address for displaying details on popup."""
@ -1612,12 +1591,6 @@ class AddbookDetailPopup(Popup):
def __init__(self, **kwargs): def __init__(self, **kwargs):
"""Method used set screen of address detail page.""" """Method used set screen of address detail page."""
super(AddbookDetailPopup, self).__init__(**kwargs) super(AddbookDetailPopup, self).__init__(**kwargs)
if state.screen_density[0] <= 720:
self.size_hint_y = 0.35
self.size_hint_x = 0.95
else:
self.size_hint_y = 0.35
self.size_hint_x = 0.7
def set_addbook_data(self, address, label): def set_addbook_data(self, address, label):
"""Getting address book data for detial dipaly.""" """Getting address book data for detial dipaly."""
@ -1694,10 +1667,6 @@ class Draft(Screen):
xAddress, account, "draft", where, what, False) xAddress, account, "draft", where, what, False)
if state.msg_counter_objs: if state.msg_counter_objs:
state.msg_counter_objs.draft_cnt.badge_text = str(len(queryreturn)) state.msg_counter_objs.draft_cnt.badge_text = str(len(queryreturn))
# state.all_count = str(int(state.all_count) + 1)
# state.msg_counter_objs.allmail_cnt.badge_text = state.all_count
# state.msg_counter_objs = None
if queryreturn: if queryreturn:
src_mng_obj = state.kivyapp.root.children[2].children[0].ids src_mng_obj = state.kivyapp.root.children[2].children[0].ids
src_mng_obj.draft_cnt.badge_text = str(len(queryreturn)) src_mng_obj.draft_cnt.badge_text = str(len(queryreturn))
@ -1772,13 +1741,7 @@ class Draft(Screen):
if int(state.draft_count) > 0: if int(state.draft_count) > 0:
msg_count_objs.draft_cnt.badge_text = str( msg_count_objs.draft_cnt.badge_text = str(
int(state.draft_count) - 1) int(state.draft_count) - 1)
# msg_count_objs.allmail_cnt.badge_text = str(
# int(state.all_count) - 1)
# msg_count_objs.trash_cnt.badge_text = str(
# int(state.trash_count) + 1)
state.draft_count = str(int(state.draft_count) - 1) state.draft_count = str(int(state.draft_count) - 1)
# state.all_count = str(int(state.all_count) - 1)
# state.trash_count = str(int(state.trash_count) + 1)
self.ids.ml.remove_widget(instance.parent.parent) self.ids.ml.remove_widget(instance.parent.parent)
toast('Deleted') toast('Deleted')
@ -1840,8 +1803,6 @@ class CustomSpinner(Spinner):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
"""Method used for setting size of spinner.""" """Method used for setting size of spinner."""
super(CustomSpinner, self).__init__(*args, **kwargs) super(CustomSpinner, self).__init__(*args, **kwargs)
# max_value = 2.8
# self.dropdown_cls.max_height = self.height / 2 * max_value + max_value * 4
self.dropdown_cls.max_height = Window.size[1] / 3 self.dropdown_cls.max_height = Window.size[1] / 3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B