Implement Ui for adding New Identity feature with navigation Enhancement

This commit is contained in:
surbhi 2018-07-24 15:35:39 +05:30
parent 1adcf7f3f4
commit 178194dd4c
No known key found for this signature in database
GPG Key ID: 88928762974D3618
2 changed files with 126 additions and 28 deletions

View File

@ -51,8 +51,10 @@
icon: 'email' icon: 'email'
text: "test" text: "test"
on_release: app.root.ids.scr_mngr.current = 'test' on_release: app.root.ids.scr_mngr.current = 'test'
NavigationDrawerIconButton:
text: "new identity"
icon:'notifications-add'
on_release: app.root.ids.scr_mngr.current = 'newidentity'
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
@ -85,6 +87,8 @@ BoxLayout:
id:sc5 id:sc5
Create: Create:
id:sc6 id:sc6
NewIdentity:
id:sc7
Button: Button:
height:100 height:100
@ -123,7 +127,7 @@ BoxLayout:
GridLayout: GridLayout:
rows: 5 rows: 5
cols: 1 cols: 1
padding: 100,100,100,100 padding: 60,60,60,60
spacing: 50 spacing: 50
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
@ -131,8 +135,13 @@ BoxLayout:
Label: Label:
text: 'FROM' text: 'FROM'
color: 0,0,0,1 color: 0,0,0,1
TextInput: Spinner:
hint_text: 'email' size_hint: 1,1
pos_hint: {"x":0,"top":1.}
pos: 10,10
id: spinner_id
text: '<select>'
values: root.showmeaddresses()
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
@ -141,7 +150,8 @@ BoxLayout:
text: 'TO' text: 'TO'
color: 0,0,0,1 color: 0,0,0,1
TextInput: TextInput:
hint_text: 'email' id: recipent
hint_text: 'To'
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
@ -150,7 +160,8 @@ BoxLayout:
text: 'SUBJECT' text: 'SUBJECT'
color: 0,0,0,1 color: 0,0,0,1
TextInput: TextInput:
hint_text: 'subject' id: subject
hint_text: 'SUBJECT'
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
@ -159,7 +170,7 @@ BoxLayout:
text: 'BODY' text: 'BODY'
color: 0,0,0,1 color: 0,0,0,1
TextInput: TextInput:
id: msg id: message
multiline:True multiline:True
size_hint: 1,2 size_hint: 1,2
@ -169,3 +180,70 @@ BoxLayout:
size_hint_x: 0.3 size_hint_x: 0.3
height: '32dp' height: '32dp'
pos_hint: {'x': .5, 'y': 0.1} pos_hint: {'x': .5, 'y': 0.1}
on_press: root.send()
<NewIdentity>:
name: 'newidentity'
GridLayout:
padding: '120dp'
cols: 1
Label:
text:"""Here you may generate as many addresses as you like. Indeed, creating and abandoning addresses is encouraged."""
line_height:1.5
text_size:(700,None)
color: 0,0,0,1
BoxLayout:
CheckBox:
canvas.before:
Color:
rgb: 1,0,0
Ellipse:
pos:self.center_x-8, self.center_y-8
size:[16,16]
group: "money"
active: root.is_active
Label:
text: "use a random number generator to make an address"
color: 0,0,0,1
BoxLayout:
CheckBox:
canvas.before:
Color:
rgb: 1,0,0
Ellipse:
pos:self.center_x-8, self.center_y-8
size:[16,16]
group: "money"
active: not root.is_active
Label:
text: "use a random number generator to make an address"
color: 0,0,0,1
Label:
color: 0,0,0,1
size_hint_x: .35
markup: True
text: "[b]{}[/b]".format("Randomly generated addresses")
BoxLayout:
size_hint_y: None
height: '32dp'
Label:
text: "Label (not shown to anyone except you)"
color: 0,0,0,1
BoxLayout:
size_hint_y: None
height: '32dp'
TextInput:
id: label
Button:
text: 'Cancel'
size_hint_y: 0.1
size_hint_x: 0.3
height: '32dp'
pos_hint: {'x': .1, 'y': 0.1}
Button:
text: 'Ok'
size_hint_y: 0.1
size_hint_x: 0.3
height: '32dp'
pos_hint: {'x': .5, 'y': 0.1}

View File

@ -1,23 +1,23 @@
import os import os
import shutdown
from kivy.app import App from kivy.app import App
from kivy.lang import Builder from kivy.lang import Builder
from kivy.uix.screenmanager import Screen from kivy.uix.screenmanager import Screen
from kivy.properties import ObjectProperty, StringProperty from kivy.properties import ObjectProperty, StringProperty
from kivymd.theming import ThemeManager from kivymd.theming import ThemeManager
from kivy.uix.widget import Widget from kivy.uix.widget import Widget
from navigationdrawer import NavigationDrawer from kivy.uix.boxlayout import BoxLayout
from kivymd.toolbar import Toolbar from kivymd.toolbar import Toolbar
from kivy.uix.dropdown import DropDown from navigationdrawer import NavigationDrawer
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label from kivy.uix.label import Label
from kivy.uix.textinput import TextInput from kivy.uix.textinput import TextInput
from kivy.clock import Clock from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout from bmconfigparser import BMConfigParser
from os import environ from kivy.properties import BooleanProperty
import shutdown statusIconColor = 'red'
class NavigateApp(App):
class NavigateApp(App, TextInput):
theme_cls = ThemeManager() theme_cls = ThemeManager()
nav_drawer = ObjectProperty() nav_drawer = ObjectProperty()
@ -31,6 +31,7 @@ class NavigateApp(App):
App.get_running_app().stop() App.get_running_app().stop()
shutdown.doCleanShutdown() shutdown.doCleanShutdown()
class Navigator(NavigationDrawer): class Navigator(NavigationDrawer):
image_source = StringProperty('images/me.jpg') image_source = StringProperty('images/me.jpg')
title = StringProperty('Navigation') title = StringProperty('Navigation')
@ -47,6 +48,7 @@ class Inbox(Screen):
val_y += .1 val_y += .1
self.add_widget(my_box1) self.add_widget(my_box1)
class Sent(Screen): class Sent(Screen):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(Sent, self).__init__(**kwargs) super(Sent, self).__init__(**kwargs)
@ -58,6 +60,7 @@ class Sent(Screen):
val_y += .1 val_y += .1
self.add_widget(my_box1) self.add_widget(my_box1)
class Trash(Screen): class Trash(Screen):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(Trash, self).__init__(**kwargs) super(Trash, self).__init__(**kwargs)
@ -78,8 +81,25 @@ class Test(Screen):
pass pass
class Create(Screen): class Create(Screen, Widget):
def __init__(self, *args, **kwargs):
super(Create, self).__init__(*args, **kwargs)
Clock.schedule_once(self.init_ui, 0)
def init_ui(self, dt=0):
# self.ids['recipent'].bind(text=self.on_text)
pass pass
def showmeaddresses(self):
return BMConfigParser().addresses()
def send(self):
pass
class NewIdentity(Screen):
is_active = BooleanProperty(False)
if __name__ == '__main__': if __name__ == '__main__':
NavigateApp().run() NavigateApp().run()