-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp.js
211 lines (179 loc) · 4.9 KB
/
temp.js
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
(function(){
shopapp.ui = {};
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
var display_width = Titanium.Platform.displayCaps.platformWidth;
shopapp.ui.createApplicationUI = function(){
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title:'Welcome',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'icons/[email protected]',
title:'Home',
window:win1
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
var productList = Titanium.UI.createScrollView({
contentWidth:'auto',
contentHeight:'auto',
top:0,
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:true
});
var view = Ti.UI.createView({
backgroundColor:'#336699',
borderRadius:10,
width:display_width,
height:200,
top:10
});
productList.add(view);
win1.add(productList);
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({
title:'Store',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'icons/[email protected]',
title:'Store-Finder',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
var data = [
{title:'Bücher', hasChild:true, test:'productView.js'},
{title:'Computer', hasChild:true, test:'../products/itemCat.js'},
{title:'Musik', hasChild:true, test:'../products/itemCat.js'},
{title:'etc', hasChild:true, test:'../products/itemCat.js'},
];
var data1 = [
{title:'1', hasChild:true, test:'productView.js'},
{title:'2', hasChild:true, test:'../products/itemCat.js'},
{title:'3', hasChild:true, test:'../products/itemCat.js'},
{title:'4', hasChild:true, test:'../products/itemCat.js'},
];
var table = Titanium.UI.createTableView({data:data});
// create table view event listener
table.addEventListener('click', function(e)
{
if (e.rowData.test)
{
var win = null;
if (Ti.Platform.name === "android") {
win = Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title
});
} else {
win = Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title,
});
table = Titanium.UI.createTableView({data:data1});
}
if (e.index === 3)
{
win.hideTabBar();
}
if (Ti.Platform.name==='android' && e.rowData.test.indexOf('window_properties.js') >= 0) {
// As explained in apidoc for Window, if opacity is ever to be changed for an Android
// activity during its lifetime, it needs to use a translucent background. We trigger
// using a translucent theme by the presence of the opacity property, so we need to
// set it here. Setting it to 1 means it's totally opaque, but gives us the property to
// make it more transparent later with the "toggle opacity" test.
win3.backgroundColor = "#191919"
win3.opacity = 1;
}
//sTitanium.UI.currentWindow.open(win,{animated:true});
win.open();
}
});
//
// create controls tab and root window
//
var win3 = Titanium.UI.createWindow({
title:'Produkte',
backgroundColor:'#fff'
});
var tab3 = Titanium.UI.createTab({
icon:'icons/[email protected]',
title:'Produkte',
window:win3
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win3.add(table);
//
// create controls tab and root window
//
var win4 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab4 = Titanium.UI.createTab({
icon:'icons/meinBereich.png',
title:'Konto',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win4.add(label2);
//
// create controls tab and root window
//
var win4 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab4 = Titanium.UI.createTab({
icon:'icons/[email protected]',
title:'Warenkorb',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win4.add(label2);
//
// add tabs
//
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
tabGroup.addTab(tab4);
return tabGroup;
};
})();