Skip to content

Commit 57f6af9

Browse files
committed
Add app icon and build basic layout
Signed-off-by: Justin Lee <lis186@gmail.com>
1 parent 6760241 commit 57f6af9

File tree

6 files changed

+67
-82
lines changed

6 files changed

+67
-82
lines changed

Resources/android/appicon.png

73.2 KB
Loading

Resources/app.js

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,50 @@
1-
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
2-
Titanium.UI.setBackgroundColor('#000');
3-
4-
// create tab group
5-
var tabGroup = Titanium.UI.createTabGroup();
6-
7-
8-
//
9-
// create base UI tab and root window
10-
//
11-
var win1 = Titanium.UI.createWindow({
12-
title:'Tab 1',
1+
var win = Titanium.UI.createWindow({
132
backgroundColor:'#fff'
143
});
15-
var tab1 = Titanium.UI.createTab({
16-
icon:'KS_nav_views.png',
17-
title:'Tab 1',
18-
window:win1
19-
});
204

21-
var label1 = Titanium.UI.createLabel({
22-
color:'#999',
23-
text:'I am Window 1',
24-
font:{fontSize:20,fontFamily:'Helvetica Neue'},
5+
var locationLabel = Titanium.UI.createLabel({
6+
color:'#000',
7+
text:'台北',
8+
font:{fontSize: 30, fontFamily:'Helvetica Neue'},
259
textAlign:'center',
26-
width:'auto'
10+
width:'auto',
11+
height: 'auto',
12+
left: 15,
13+
top: 75
2714
});
2815

29-
win1.add(label1);
30-
31-
//
32-
// create controls tab and root window
33-
//
34-
var win2 = Titanium.UI.createWindow({
35-
title:'Tab 2',
36-
backgroundColor:'#fff'
37-
});
38-
var tab2 = Titanium.UI.createTab({
39-
icon:'KS_nav_ui.png',
40-
title:'Tab 2',
41-
window:win2
16+
var weatherIcon = Titanium.UI.createImageView({
17+
image: 'images/mostly_cloudy.gif',
18+
width: 80,
19+
height: 80,
20+
left: 15,
21+
top: 120
4222
});
4323

44-
var label2 = Titanium.UI.createLabel({
45-
color:'#999',
46-
text:'I am Window 2',
47-
font:{fontSize:20,fontFamily:'Helvetica Neue'},
24+
var temperatureLabel = Titanium.UI.createLabel({
25+
color:'#000',
26+
text:'28°C',
27+
font:{fontSize: 90, fontFamily:'Helvetica Neue'},
4828
textAlign:'center',
49-
width:'auto'
29+
width:'auto',
30+
height: 'auto',
31+
right: 15,
32+
top: 100
5033
});
5134

52-
win2.add(label2);
53-
54-
55-
56-
//
57-
// add tabs
58-
//
59-
tabGroup.addTab(tab1);
60-
tabGroup.addTab(tab2);
61-
35+
var detailLabel = Titanium.UI.createLabel({
36+
color:'#000',
37+
text: '多雲時陰\n濕度: 62%\n風向: 西北\n風速:10 公里/小時',
38+
font:{fontSize: 24, fontFamily:'Helvetica Neue'},
39+
textAlign:'left',
40+
width:'auto',
41+
height: 'auto',
42+
left: 20,
43+
top: 220
44+
});
6245

63-
// open tab group
64-
tabGroup.open();
46+
win.add(locationLabel);
47+
win.add(weatherIcon);
48+
win.add(temperatureLabel);
49+
win.add(detailLabel);
50+
win.open();

Resources/images/mostly_cloudy.gif

1.05 KB
Loading

Resources/iphone/appicon.png

61.1 KB
Loading

Resources/iphone/appicon@2x.png

93.5 KB
Loading

build/iphone/Info.plist

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,49 @@
1010
<string>${EXECUTABLE_NAME}</string>
1111
<key>CFBundleIconFile</key>
1212
<string>appicon.png</string>
13-
<key>CFBundleIdentifier</key>
14-
<string>com.appcelerator.titanium.ks</string>
15-
<key>CFBundleInfoDictionaryVersion</key>
16-
<string>6.0</string>
17-
<key>CFBundleName</key>
18-
<string>${PRODUCT_NAME}</string>
19-
<key>CFBundlePackageType</key>
20-
<string>APPL</string>
21-
<key>CFBundleSignature</key>
22-
<string>????</string>
13+
<key>CFBundleIconFiles</key>
14+
<array>
15+
<string>appicon.png</string>
16+
<string>appicon@2x.png</string>
17+
</array>
2318
<key>CFBundleURLTypes</key>
2419
<array>
2520
<dict>
2621
<key>CFBundleURLName</key>
27-
<string>com.appcelerator.kitchensink</string>
22+
<string>co.herxun.HowIsTheWeather</string>
2823
<key>CFBundleURLSchemes</key>
2924
<array>
30-
<string>kitchensink</string>
31-
<string>fb134793934930</string>
25+
<string>howistheweather</string>
26+
3227
</array>
3328
</dict>
3429
</array>
30+
<key>CFBundleIdentifier</key>
31+
<string>co.herxun.HowIsTheWeather</string>
32+
<key>CFBundleInfoDictionaryVersion</key>
33+
<string>6.0</string>
34+
<key>CFBundleName</key>
35+
<string>${PRODUCT_NAME}</string>
36+
<key>CFBundlePackageType</key>
37+
<string>APPL</string>
38+
<key>CFBundleSignature</key>
39+
<string>????</string>
3540
<key>CFBundleVersion</key>
3641
<string>1.0</string>
3742
<key>LSRequiresIPhoneOS</key>
3843
<true/>
39-
<key>UIAppFonts</key>
40-
<array>
41-
<string>comic_zine_ot.otf</string>
42-
</array>
43-
<key>UIBackgroundModes</key>
44-
<array>
45-
<string>audio</string>
44+
<key>UISupportedInterfaceOrientations~ipad</key>
45+
<array>
46+
<string>UIInterfaceOrientationPortrait</string>
47+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
48+
<string>UIInterfaceOrientationLandscapeLeft</string>
49+
<string>UIInterfaceOrientationLandscapeRight</string>
4650
</array>
47-
<key>UISupportedInterfaceOrientations</key>
48-
<array>
49-
<string>UIInterfaceOrientationPortrait</string>
50-
</array>
51-
<key>UISupportedInterfaceOrientations~ipad</key>
52-
<array>
53-
<string>UIInterfaceOrientationPortrait</string>
54-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
55-
<string>UIInterfaceOrientationLandscapeLeft</string>
56-
<string>UIInterfaceOrientationLandscapeRight</string>
51+
<key>UISupportedInterfaceOrientations</key>
52+
<array>
53+
<string>UIInterfaceOrientationPortrait</string>
5754
</array>
55+
<key>UIStatusBarStyle</key>
56+
<string>UIStatusBarStyleDefault</string>
5857
</dict>
5958
</plist>

0 commit comments

Comments
 (0)