worked on payment screen UI or qr code scanner feature
This commit is contained in:
parent
0b7070eae4
commit
05d061fe0a
|
@ -13,7 +13,7 @@
|
|||
hint_text: 'type or select sender address'
|
||||
size_hint_y: None
|
||||
height: 100
|
||||
font_size: '13sp'
|
||||
font_size: '15sp'
|
||||
multiline: False
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
|
@ -26,15 +26,17 @@
|
|||
background_color: app.theme_cls.primary_dark
|
||||
values: app.variable_1
|
||||
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_down: 'atlas://data/images/defaulttheme/spinner'
|
||||
background_normal: ''
|
||||
background_color: app.theme_cls.primary_color
|
||||
color: color_font
|
||||
font_size: '12.5sp'
|
||||
font_size: '13.5sp'
|
||||
ArrowImg:
|
||||
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
txt_input: txt_input
|
||||
|
@ -43,17 +45,22 @@
|
|||
MyTextInput:
|
||||
id: txt_input
|
||||
size_hint_y: None
|
||||
font_size: '13sp'
|
||||
font_size: '15sp'
|
||||
height: self.parent.height/2
|
||||
hint_text: 'type, select or scan QR code for recipients address'
|
||||
# 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:
|
||||
id: subject
|
||||
hint_text: 'subject'
|
||||
required: True
|
||||
height: 100
|
||||
font_size: '13sp'
|
||||
font_size: '15sp'
|
||||
size_hint_y: None
|
||||
multiline: False
|
||||
helper_text_mode: "on_error"
|
||||
|
@ -63,7 +70,7 @@
|
|||
multiline: True
|
||||
hint_text: 'body'
|
||||
size_hint_y: None
|
||||
font_size: '13sp'
|
||||
font_size: '15sp'
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
BoxLayout:
|
||||
|
@ -107,3 +114,12 @@
|
|||
canvas.before:
|
||||
Color:
|
||||
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
|
|
@ -78,6 +78,7 @@
|
|||
halign: 'center'
|
||||
color: 1,1,1,1
|
||||
MDLabel:
|
||||
id: py2
|
||||
font_style: 'H5'
|
||||
theme_text_color: 'Primary'
|
||||
text: '€ 100.0'
|
||||
|
@ -92,6 +93,8 @@
|
|||
size: self.size
|
||||
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1
|
||||
height: dp(40)
|
||||
on_press: app.root.ids.scr_mngr.current = 'pay-options'
|
||||
on_press: root.move_to_pay_option(py2.text)
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Get Monthly Credits'
|
||||
|
@ -122,6 +125,7 @@
|
|||
halign: 'center'
|
||||
color: 1,1,1,1
|
||||
MDLabel:
|
||||
id: py3
|
||||
font_style: 'H5'
|
||||
theme_text_color: 'Primary'
|
||||
text: '€ 500.0'
|
||||
|
@ -136,6 +140,8 @@
|
|||
size: self.size
|
||||
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1
|
||||
height: dp(40)
|
||||
on_press: app.root.ids.scr_mngr.current = 'pay-options'
|
||||
on_press: root.move_to_pay_option(py3.text)
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Get Yearly Credits'
|
||||
|
|
57
src/bitmessagekivy/kv/payment_method.kv
Normal file
57
src/bitmessagekivy/kv/payment_method.kv
Normal 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)
|
|
@ -28,6 +28,7 @@
|
|||
#background_down: 'atlas://data/images/defaulttheme/button'
|
||||
background_normal: 'atlas://data/images/defaulttheme/textinput_active'
|
||||
background_color: app.theme_cls.primary_color
|
||||
# text_autoupdate: True
|
||||
color: color_font
|
||||
|
||||
<NavigationItem>
|
||||
|
@ -101,7 +102,7 @@
|
|||
id: btn
|
||||
pos_hint:{"x":0,"y":0}
|
||||
option_cls: Factory.get("MySpinnerOption")
|
||||
font_size: '10.9sp'
|
||||
font_size: '12.5sp'
|
||||
text: app.getDefaultAccData()
|
||||
#background_color: color_button if self.state == 'normal' else color_button_pressed
|
||||
#background_down: 'atlas://data/images/defaulttheme/spinner'
|
||||
|
@ -111,11 +112,11 @@
|
|||
#background_color: (0.62,0.67,0.72,1)
|
||||
values: app.variable_1
|
||||
on_text:app.getCurrentAccountData(self.text)
|
||||
Image:
|
||||
source: app.get_default_image()
|
||||
x: self.width/6
|
||||
y: self.parent.y + self.parent.height/4
|
||||
size: self.parent.height/2, self.parent.height/2
|
||||
# Image:
|
||||
# source: app.get_default_image()
|
||||
# x: self.width/6
|
||||
# y: self.parent.y + self.parent.height/4
|
||||
# size: self.parent.height/2, self.parent.height/2
|
||||
ArrowImg:
|
||||
NavigationItem:
|
||||
id: inbox_cnt
|
||||
|
@ -258,6 +259,8 @@ NavigationLayout:
|
|||
id:sc19
|
||||
Archieve:
|
||||
id:sc20
|
||||
PaymentMethods:
|
||||
id:sc21
|
||||
|
||||
MDNavigationDrawer:
|
||||
id: nav_drawer
|
||||
|
|
|
@ -73,7 +73,8 @@ KVFILES = [
|
|||
'settings', 'popup', 'allmails', 'draft',
|
||||
'maildetail', 'common_widgets', 'addressbook',
|
||||
'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.focus = True
|
||||
|
||||
def qrScanner(self):
|
||||
"""This method is used for scanning Qr code"""
|
||||
pass
|
||||
|
||||
|
||||
class MyTextInput(TextInput):
|
||||
"""Takes the text input in the field"""
|
||||
|
@ -835,14 +840,14 @@ class MyTextInput(TextInput):
|
|||
|
||||
def on_text(self, instance, value):
|
||||
"""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(
|
||||
len(self.word_list)) if self.word_list[
|
||||
i][:self.starting_no] == value[:self.starting_no]]
|
||||
display_data = []
|
||||
for i in matches:
|
||||
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:
|
||||
self.parent.height = (250 + (len(matches) * 20))
|
||||
else:
|
||||
|
@ -874,6 +879,9 @@ class Payment(Screen):
|
|||
state.kivyapp.root.ids.sc18.ids.cred.text = '{0}'.format(
|
||||
state.availabe_credit)
|
||||
|
||||
def move_to_pay_option(self, amount):
|
||||
state.kivyapp.set_toolbar_for_QrCode()
|
||||
|
||||
|
||||
class Credits(Screen):
|
||||
"""Credits Method"""
|
||||
|
@ -1579,6 +1587,9 @@ class NavigateApp(MDApp):
|
|||
self.root.ids.scr_mngr.current = 'myaddress'
|
||||
elif self.root.ids.scr_mngr.current == "random":
|
||||
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:
|
||||
if state.kivyapp.variable_1:
|
||||
self.root.ids.scr_mngr.current = 'inbox'
|
||||
|
@ -1704,7 +1715,8 @@ class NavigateApp(MDApp):
|
|||
if state.in_composer else 'allmails'\
|
||||
if state.is_allmail else state.detailPageType\
|
||||
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.bind(on_complete=self.reset)
|
||||
if state.is_allmail or state.detailPageType == 'draft':
|
||||
|
@ -1842,7 +1854,7 @@ class NavigateApp(MDApp):
|
|||
def set_identicon(self, text):
|
||||
"""Show identicon in address spinner"""
|
||||
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
|
||||
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):
|
||||
"""This method load the selected image on screen"""
|
||||
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.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr)
|
||||
# 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)
|
||||
top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr)
|
||||
top_box_obj.reload()
|
||||
spinner_img_obj.reload()
|
||||
# spinner_img_obj.reload()
|
||||
|
||||
def copy_composer_text(self, text):
|
||||
"""Copy the data from mail detail page"""
|
||||
|
@ -2096,6 +2109,12 @@ class ToggleBtn(IRightBodyTouch, MDSwitch):
|
|||
pass
|
||||
|
||||
|
||||
class CheckboxLeftSampleWidget(ILeftBodyTouch, MDCheckbox):
|
||||
"""Left icon sample widget"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class MailDetail(Screen):
|
||||
"""MailDetail Screen uses to show the detail of mails"""
|
||||
|
||||
|
@ -2945,5 +2964,12 @@ class ToAddrBoxlayout(BoxLayout):
|
|||
to_addr = StringProperty()
|
||||
|
||||
def set_toAddress(self, to_addr):
|
||||
"""This method is use to set to address"""
|
||||
self.to_addr = to_addr
|
||||
|
||||
|
||||
class PaymentMethods(Screen):
|
||||
"""PaymentMethods Screen show widgets of page"""
|
||||
|
||||
def redirect_on_web(self, instance):
|
||||
pass
|
||||
|
|
BIN
src/images/paymode/111.webp
Normal file
BIN
src/images/paymode/111.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
src/images/paymode/bitcoin-logo.jpg
Normal file
BIN
src/images/paymode/bitcoin-logo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
BIN
src/images/paymode/download.png
Normal file
BIN
src/images/paymode/download.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
Reference in New Issue
Block a user