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'
text: "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:
orientation: 'vertical'
@ -85,6 +87,8 @@ BoxLayout:
id:sc5
Create:
id:sc6
NewIdentity:
id:sc7
Button:
height:100
@ -123,7 +127,7 @@ BoxLayout:
GridLayout:
rows: 5
cols: 1
padding: 100,100,100,100
padding: 60,60,60,60
spacing: 50
BoxLayout:
size_hint_y: None
@ -131,8 +135,13 @@ BoxLayout:
Label:
text: 'FROM'
color: 0,0,0,1
TextInput:
hint_text: 'email'
Spinner:
size_hint: 1,1
pos_hint: {"x":0,"top":1.}
pos: 10,10
id: spinner_id
text: '<select>'
values: root.showmeaddresses()
BoxLayout:
size_hint_y: None
@ -141,7 +150,8 @@ BoxLayout:
text: 'TO'
color: 0,0,0,1
TextInput:
hint_text: 'email'
id: recipent
hint_text: 'To'
BoxLayout:
size_hint_y: None
@ -150,7 +160,8 @@ BoxLayout:
text: 'SUBJECT'
color: 0,0,0,1
TextInput:
hint_text: 'subject'
id: subject
hint_text: 'SUBJECT'
BoxLayout:
size_hint_y: None
@ -159,7 +170,7 @@ BoxLayout:
text: 'BODY'
color: 0,0,0,1
TextInput:
id: msg
id: message
multiline:True
size_hint: 1,2
@ -169,3 +180,70 @@ BoxLayout:
size_hint_x: 0.3
height: '32dp'
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 shutdown
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivy.properties import ObjectProperty, StringProperty
from kivymd.theming import ThemeManager
from kivy.uix.widget import Widget
from navigationdrawer import NavigationDrawer
from kivy.uix.boxlayout import BoxLayout
from kivymd.toolbar import Toolbar
from kivy.uix.dropdown import DropDown
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from navigationdrawer import NavigationDrawer
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout
from os import environ
import shutdown
from bmconfigparser import BMConfigParser
from kivy.properties import BooleanProperty
statusIconColor = 'red'
class NavigateApp(App):
class NavigateApp(App, TextInput):
theme_cls = ThemeManager()
nav_drawer = ObjectProperty()
@ -31,42 +31,45 @@ class NavigateApp(App):
App.get_running_app().stop()
shutdown.doCleanShutdown()
class Navigator(NavigationDrawer):
image_source = StringProperty('images/me.jpg')
title = StringProperty('Navigation')
class Inbox(Screen):
def __init__ (self,**kwargs):
super (Inbox, self).__init__(**kwargs)
def __init__(self, **kwargs):
super(Inbox, self).__init__(**kwargs)
val_y = .1
val_z = 0
my_box1 = BoxLayout(orientation='vertical')
for i in range(1, 5):
my_box1.add_widget(Label(text="I am in inbox", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
val_y+=.1
val_y += .1
self.add_widget(my_box1)
class Sent(Screen):
def __init__ (self,**kwargs):
super (Sent, self).__init__(**kwargs)
def __init__(self, **kwargs):
super(Sent, self).__init__(**kwargs)
val_y = .1
val_z = 0
my_box1 = BoxLayout(orientation='vertical')
for i in range(1, 5):
my_box1.add_widget(Label(text="I am in sent", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
val_y+=.1
val_y += .1
self.add_widget(my_box1)
class Trash(Screen):
def __init__ (self,**kwargs):
super (Trash, self).__init__(**kwargs)
def __init__(self, **kwargs):
super(Trash, self).__init__(**kwargs)
val_y = .1
val_z = 0
my_box1 = BoxLayout(orientation='vertical')
for i in range(1, 5):
my_box1.add_widget(Label(text="I am in trash", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
val_y+=.1
val_y += .1
self.add_widget(my_box1)
@ -78,8 +81,25 @@ class Test(Screen):
pass
class Create(Screen):
pass
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
def showmeaddresses(self):
return BMConfigParser().addresses()
def send(self):
pass
class NewIdentity(Screen):
is_active = BooleanProperty(False)
if __name__ == '__main__':
NavigateApp().run()