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
|
(function() {
function create_row( key )
{
// Ti.UI.createAlertDialog( {title:"key " + key.name} ).show();
// Reason for Factory: templating format of the row
var row = Ti.UI.createTableViewRow();
row.addEventListener('click', function(e) {
Ti.UI.currentTabGroup.activeTab.open(fs.ui.createWebViewWin({
title: key.name,
url: key.page_url
}));
});
/*
description
fan_count
page_url
website
*/
var profile_icon = Ti.UI.createImageView({
image:key.pic_square,
width:50,
height:50,
left:0,
top:0
});
var content = Ti.UI.createLabel({
text:key.name,
font:{fontSize:12,fontWeight:'bold'},
width:'auto',
textAlign:'left',
top:2,
left:52,
height:26
});
row.height = 50;
row.add( profile_icon );
row.add( content );
return row;
}
fs.ui.createLikeList = function() {
var ll_view = Ti.UI.createTableView();
Ti.API.addEventListener("processPosts", function(d) {
for ( key in d.data ) {
ll_view.appendRow( create_row( d.data[key] ) );
}
});
return ll_view;
};
})();
|