worked on payment screen UI or qr code scanner feature

This commit is contained in:
navjot 2020-03-09 13:24:10 +05:30
parent 0b7070eae4
commit 05d061fe0a
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
8 changed files with 141 additions and 33 deletions

View File

@ -13,7 +13,7 @@
hint_text: 'type or select sender address' hint_text: 'type or select sender address'
size_hint_y: None size_hint_y: None
height: 100 height: 100
font_size: '13sp' font_size: '15sp'
multiline: False multiline: False
required: True required: True
helper_text_mode: "on_error" helper_text_mode: "on_error"
@ -26,34 +26,41 @@
background_color: app.theme_cls.primary_dark background_color: app.theme_cls.primary_dark
values: app.variable_1 values: app.variable_1
on_text: root.auto_fill_fromaddr() if self.text != 'Select' else '' on_text: root.auto_fill_fromaddr() if self.text != 'Select' else ''
option_cls: Factory.get("MySpinnerOption") option_cls: Factory.get("ComposerSpinnerOption")
#background_color: color_button if self.state == 'normal' else color_button_pressed #background_color: color_button if self.state == 'normal' else color_button_pressed
#background_down: 'atlas://data/images/defaulttheme/spinner' #background_down: 'atlas://data/images/defaulttheme/spinner'
background_normal: '' background_normal: ''
background_color: app.theme_cls.primary_color background_color: app.theme_cls.primary_color
color: color_font color: color_font
font_size: '12.5sp' font_size: '13.5sp'
ArrowImg: ArrowImg:
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'horizontal'
txt_input: txt_input BoxLayout:
rv: rv orientation: 'vertical'
size : (890, 60) txt_input: txt_input
MyTextInput: rv: rv
id: txt_input size : (890, 60)
size_hint_y: None MyTextInput:
font_size: '13sp' id: txt_input
height: self.parent.height/2 size_hint_y: None
hint_text: 'type, select or scan QR code for recipients address' font_size: '15sp'
RV: height: self.parent.height/2
id: rv # hint_text: 'type, select or scan QR code for recipients address'
RV:
id: rv
MDIconButton:
icon: 'qrcode-scan'
pos_hint: {'center_x': 0, 'center_y': .8}
on_press: root.qrScanner()
MyMDTextField: MyMDTextField:
id: subject id: subject
hint_text: 'subject' hint_text: 'subject'
required: True required: True
height: 100 height: 100
font_size: '13sp' font_size: '15sp'
size_hint_y: None size_hint_y: None
multiline: False multiline: False
helper_text_mode: "on_error" helper_text_mode: "on_error"
@ -63,7 +70,7 @@
multiline: True multiline: True
hint_text: 'body' hint_text: 'body'
size_hint_y: None size_hint_y: None
font_size: '13sp' font_size: '15sp'
required: True required: True
helper_text_mode: "on_error" helper_text_mode: "on_error"
BoxLayout: BoxLayout:
@ -107,3 +114,12 @@
canvas.before: canvas.before:
Color: Color:
rgba: (0,0,0,1) rgba: (0,0,0,1)
<ComposerSpinnerOption@SpinnerOption>:
font_size: '13.5sp'
#background_color: color_button if self.state == 'down' else color_button_pressed
#background_down: 'atlas://data/images/defaulttheme/button'
background_normal: 'atlas://data/images/defaulttheme/textinput_active'
background_color: app.theme_cls.primary_color
color: color_font

View File

@ -78,6 +78,7 @@
halign: 'center' halign: 'center'
color: 1,1,1,1 color: 1,1,1,1
MDLabel: MDLabel:
id: py2
font_style: 'H5' font_style: 'H5'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: '€ 100.0' text: '€ 100.0'
@ -92,6 +93,8 @@
size: self.size size: self.size
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1
height: dp(40) height: dp(40)
on_press: app.root.ids.scr_mngr.current = 'pay-options'
on_press: root.move_to_pay_option(py2.text)
MDLabel: MDLabel:
font_style: 'H6' font_style: 'H6'
text: 'Get Monthly Credits' text: 'Get Monthly Credits'
@ -122,6 +125,7 @@
halign: 'center' halign: 'center'
color: 1,1,1,1 color: 1,1,1,1
MDLabel: MDLabel:
id: py3
font_style: 'H5' font_style: 'H5'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: '€ 500.0' text: '€ 500.0'
@ -136,6 +140,8 @@
size: self.size size: self.size
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1
height: dp(40) height: dp(40)
on_press: app.root.ids.scr_mngr.current = 'pay-options'
on_press: root.move_to_pay_option(py3.text)
MDLabel: MDLabel:
font_style: 'H6' font_style: 'H6'
text: 'Get Yearly Credits' text: 'Get Yearly Credits'

View File

@ -0,0 +1,57 @@
<PaymentMethods>:
name: 'pay-options'
ScrollView:
do_scroll_x: False
BoxLayout:
# canvas.before:
# Color:
# rgba: .5,.5,.5,.5
# Rectangle:
# pos: self.pos
# size: self.size
orientation: 'vertical'
padding: [self.width/4, 20, self.width/4, 20]
size_hint_y: None
spacing: 20
height: self.minimum_height
# GridLayout:
# cols: 1
# rows: 3
# size_hint_y: None
# # height: self.minimum_height
# # padding: dp(10), dp(10)
# spacing: dp(10)
SmartTileWithLabel:
# size_hint_y: None
size_hint: (None, None)
# pos_hint: {'x': .5, 'y': .5}
height: 180
width: 400
id: tile_2
mipmap: True
source: './images/paymode/download.png'
# text: "[size=12]Paypal[/size]"
on_press: root.redirect_on_web(self)
font_style: 'Subtitle1'
SmartTileWithLabel:
# size_hint_y: None
size_hint: (None, None)
height: 180
width: 400
id: tile_2
mipmap: True
# text: "[size=12]Crypto wallet[/size]"
font_style: 'Subtitle1'
source: './images/paymode/bitcoin-logo.jpg'
on_press: root.redirect_on_web(self)
SmartTileWithLabel:
# size_hint_y: None
size_hint: (None, None)
height: 180
width: 400
id: tile_2
mipmap: True
# text: "[size=12]Googgle in app[/size]"
font_style: 'Subtitle1'
source: './images/paymode/111.webp'
on_press: root.redirect_on_web(self)

View File

@ -28,6 +28,7 @@
#background_down: 'atlas://data/images/defaulttheme/button' #background_down: 'atlas://data/images/defaulttheme/button'
background_normal: 'atlas://data/images/defaulttheme/textinput_active' background_normal: 'atlas://data/images/defaulttheme/textinput_active'
background_color: app.theme_cls.primary_color background_color: app.theme_cls.primary_color
# text_autoupdate: True
color: color_font color: color_font
<NavigationItem> <NavigationItem>
@ -101,7 +102,7 @@
id: btn id: btn
pos_hint:{"x":0,"y":0} pos_hint:{"x":0,"y":0}
option_cls: Factory.get("MySpinnerOption") option_cls: Factory.get("MySpinnerOption")
font_size: '10.9sp' font_size: '12.5sp'
text: app.getDefaultAccData() text: app.getDefaultAccData()
#background_color: color_button if self.state == 'normal' else color_button_pressed #background_color: color_button if self.state == 'normal' else color_button_pressed
#background_down: 'atlas://data/images/defaulttheme/spinner' #background_down: 'atlas://data/images/defaulttheme/spinner'
@ -111,11 +112,11 @@
#background_color: (0.62,0.67,0.72,1) #background_color: (0.62,0.67,0.72,1)
values: app.variable_1 values: app.variable_1
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/6 # x: self.width/6
y: self.parent.y + self.parent.height/4 # y: self.parent.y + self.parent.height/4
size: self.parent.height/2, self.parent.height/2 # size: self.parent.height/2, self.parent.height/2
ArrowImg: ArrowImg:
NavigationItem: NavigationItem:
id: inbox_cnt id: inbox_cnt
@ -258,6 +259,8 @@ NavigationLayout:
id:sc19 id:sc19
Archieve: Archieve:
id:sc20 id:sc20
PaymentMethods:
id:sc21
MDNavigationDrawer: MDNavigationDrawer:
id: nav_drawer id: nav_drawer

View File

@ -73,7 +73,8 @@ KVFILES = [
'settings', 'popup', 'allmails', 'draft', 'settings', 'popup', 'allmails', 'draft',
'maildetail', 'common_widgets', 'addressbook', 'maildetail', 'common_widgets', 'addressbook',
'myaddress', 'composer', 'payment', 'sent', 'myaddress', 'composer', 'payment', 'sent',
'network', 'login', 'credits', 'trash', 'inbox' 'network', 'login', 'credits', 'trash', 'inbox',
'payment_method'
] ]
@ -818,6 +819,10 @@ class DropDownWidget(BoxLayout):
self.ids.ti.text = self.ids.btn.text self.ids.ti.text = self.ids.btn.text
self.ids.ti.focus = True self.ids.ti.focus = True
def qrScanner(self):
"""This method is used for scanning Qr code"""
pass
class MyTextInput(TextInput): class MyTextInput(TextInput):
"""Takes the text input in the field""" """Takes the text input in the field"""
@ -835,14 +840,14 @@ class MyTextInput(TextInput):
def on_text(self, instance, value): def on_text(self, instance, value):
"""Find all the occurrence of the word""" """Find all the occurrence of the word"""
self.parent.parent.parent.parent.ids.rv.data = [] self.parent.parent.parent.parent.parent.ids.rv.data = []
matches = [self.word_list[i] for i in range( matches = [self.word_list[i] for i in range(
len(self.word_list)) if self.word_list[ len(self.word_list)) if self.word_list[
i][:self.starting_no] == value[:self.starting_no]] i][:self.starting_no] == value[:self.starting_no]]
display_data = [] display_data = []
for i in matches: for i in matches:
display_data.append({'text': i}) display_data.append({'text': i})
self.parent.parent.parent.parent.ids.rv.data = display_data self.parent.parent.parent.parent.parent.ids.rv.data = display_data
if len(matches) <= 10: if len(matches) <= 10:
self.parent.height = (250 + (len(matches) * 20)) self.parent.height = (250 + (len(matches) * 20))
else: else:
@ -874,6 +879,9 @@ class Payment(Screen):
state.kivyapp.root.ids.sc18.ids.cred.text = '{0}'.format( state.kivyapp.root.ids.sc18.ids.cred.text = '{0}'.format(
state.availabe_credit) state.availabe_credit)
def move_to_pay_option(self, amount):
state.kivyapp.set_toolbar_for_QrCode()
class Credits(Screen): class Credits(Screen):
"""Credits Method""" """Credits Method"""
@ -1579,6 +1587,9 @@ class NavigateApp(MDApp):
self.root.ids.scr_mngr.current = 'myaddress' self.root.ids.scr_mngr.current = 'myaddress'
elif self.root.ids.scr_mngr.current == "random": elif self.root.ids.scr_mngr.current == "random":
self.root.ids.scr_mngr.current = 'login' self.root.ids.scr_mngr.current = 'login'
elif self.root.ids.scr_mngr.current == 'pay-options':
self.set_common_header()
self.root.ids.scr_mngr.current = 'payment'
else: else:
if state.kivyapp.variable_1: if state.kivyapp.variable_1:
self.root.ids.scr_mngr.current = 'inbox' self.root.ids.scr_mngr.current = 'inbox'
@ -1704,7 +1715,8 @@ class NavigateApp(MDApp):
if state.in_composer else 'allmails'\ if state.in_composer else 'allmails'\
if state.is_allmail else state.detailPageType\ if state.is_allmail else state.detailPageType\
if state.detailPageType else 'myaddress'\ if state.detailPageType else 'myaddress'\
if self.root.ids.scr_mngr.current == 'showqrcode' else 'inbox' if self.root.ids.scr_mngr.current == 'showqrcode' else 'payment'\
if self.root.ids.scr_mngr.current == 'pay-options' else 'inbox'
self.root.ids.scr_mngr.transition.direction = 'right' self.root.ids.scr_mngr.transition.direction = 'right'
self.root.ids.scr_mngr.transition.bind(on_complete=self.reset) self.root.ids.scr_mngr.transition.bind(on_complete=self.reset)
if state.is_allmail or state.detailPageType == 'draft': if state.is_allmail or state.detailPageType == 'draft':
@ -1842,7 +1854,7 @@ class NavigateApp(MDApp):
def set_identicon(self, text): def set_identicon(self, text):
"""Show identicon in address spinner""" """Show identicon in address spinner"""
img = identiconGeneration.generate(text) img = identiconGeneration.generate(text)
self.root.children[0].children[0].ids.btn.children[1].texture = (img.texture) # self.root.children[0].children[0].ids.btn.children[1].texture = (img.texture)
# below line is for displaing logo # below line is for displaing logo
self.root.ids.content_drawer.ids.top_box.children[0].texture = (img.texture) self.root.ids.content_drawer.ids.top_box.children[0].texture = (img.texture)
@ -1941,10 +1953,11 @@ class NavigateApp(MDApp):
def load_selected_Image(self, curerentAddr): def load_selected_Image(self, curerentAddr):
"""This method load the selected image on screen""" """This method load the selected image on screen"""
top_box_obj = self.root.ids.content_drawer.ids.top_box.children[0] top_box_obj = self.root.ids.content_drawer.ids.top_box.children[0]
spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1] # spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1]
spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) # spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr)
top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr)
top_box_obj.reload() top_box_obj.reload()
spinner_img_obj.reload() # spinner_img_obj.reload()
def copy_composer_text(self, text): def copy_composer_text(self, text):
"""Copy the data from mail detail page""" """Copy the data from mail detail page"""
@ -2096,6 +2109,12 @@ class ToggleBtn(IRightBodyTouch, MDSwitch):
pass pass
class CheckboxLeftSampleWidget(ILeftBodyTouch, MDCheckbox):
"""Left icon sample widget"""
pass
class MailDetail(Screen): class MailDetail(Screen):
"""MailDetail Screen uses to show the detail of mails""" """MailDetail Screen uses to show the detail of mails"""
@ -2945,5 +2964,12 @@ class ToAddrBoxlayout(BoxLayout):
to_addr = StringProperty() to_addr = StringProperty()
def set_toAddress(self, to_addr): def set_toAddress(self, to_addr):
"""This method is use to set to address"""
self.to_addr = to_addr self.to_addr = to_addr
class PaymentMethods(Screen):
"""PaymentMethods Screen show widgets of page"""
def redirect_on_web(self, instance):
pass pass

BIN
src/images/paymode/111.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB