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
|
(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();
/*
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.addItems = function( list )
{
Ti.UI.createAlertDialog( {title:"Items: " + list.list.length} ).show();
for ( key in list.list ) {
ll_view.appendRow( create_row( key ) );
}
}
fs.ui.createLikeList = function() {
var ll_view = Ti.UI.createTableView();
ll_view.addEventListener('click', function(e) {
Ti.UI.currentTabGroup.activeTab.open(fs.ui.createWebViewWin({
title: e.title,
url: e.url
}));
});
Ti.API.addEventListener( "processPosts", fs.ui.addItems );
return ll_view;
};
})();
|