-
Notifications
You must be signed in to change notification settings - Fork 0
/
expdataview.py
76 lines (66 loc) · 1.91 KB
/
expdataview.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.recycleview import RecycleView
from kivy.uix.popup import Popup
from kivy.uix.boxlayout import BoxLayout
Builder.load_string('''
#:kivy 1.10.0
#: import Popup kivy.uix.popup
<RecycleViewRow>:
orientation: 'horizontal'
Label:
text: root.category
Label:
text: root.remarks
BoxLayout:
orientation:'vertical'
Label:
text:root.date
Label:
text:root.time
Label:
text:root.mode
Label:
text:root.amount
<MainScreen>:
viewclass: 'RecycleViewRow'
RecycleBoxLayout:
default_size: None, dp(56)
default_size_hint: 1, None
default_spacing:dp(30)
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
''')
class MessageBox(Popup):
message = StringProperty()
class RecycleViewRow(BoxLayout):
category = StringProperty()
remarks = StringProperty()
date = StringProperty()
time = StringProperty()
mode = StringProperty()
amount = StringProperty()
class MainScreen(RecycleView):
def __init__(self, **kwargs):
super(MainScreen, self).__init__(**kwargs)
self.data = [{'category': "Button " + str(x),
'remarks': str(x),
'date': str(x),
'time': str(x),
'mode': str(x),
'amount': 'amount'}
for x in range(3)]
def message_box(self, message):
p = MessageBox()
p.message = message
p.open()
print('test press: ', message)
class TestApp(App):
title = "RecycleView Direct Test"
def build(self):
return MainScreen()
if __name__ == "__main__":
TestApp().run()