Permalink
Browse files

Merge branch '6780893'

  • Loading branch information...
k0sukey committed Jul 15, 2012
2 parents ced6769 + 6780893 commit f2c3b286ceee11a5a1d61b8efa2d228928df2f85
Showing with 44 additions and 27 deletions.
  1. +1 −1 Info.plist
  2. +37 −24 Resources/app.js
  3. BIN Resources/{font → fonts}/fontawesome-webfont.ttf
  4. +6 −2 tiapp.xml
View
@@ -56,7 +56,7 @@
<string>UIStatusBarStyleDefault</string>
<key>UIAppFonts</key>
<array>
- <string>/font/fontawesome-webfont.ttf</string>
+ <string>/fonts/fontawesome-webfont.ttf</string>
</array>
</dict>
</plist>
View
@@ -2,60 +2,73 @@
var window = Ti.UI.createWindow({
backgroundColor: '#fff'
});
-/*
- var textField = Ti.UI.createTextField({
- top: 10,
- left: 10,
- width: 300,
- height: 30,
- borderWidth: 1,
- clearButtonMode: Ti.UI.INPUT_BUTTONMODE_ONFOCUS,
- paddingLeft: 10,
- value: '',
- hintText: 'This is hintText',
- font: { fontSize: 18, fontFamily: 'FontopoSUBWAY' }
- });
- window.add(textField);
-*/
+
+ var osname = Ti.Platform.osname;
+ var os = function(/*Object*/ map) {
+ var def = map.def||null; //default function or value
+ if (map[osname]) {
+ if (typeof map[osname] == 'function') { return map[osname](); }
+ else { return map[osname]; }
+ }
+ else {
+ if (typeof def == 'function') { return def(); }
+ else { return def; }
+ }
+ };
var fontawesome = require('FontAwesome').FontAwesome();
-
+
+ var wrapView = Ti.UI.createView({
+ height : 200
+ });
+ window.add(wrapView);
+
var octocatLabel = Ti.UI.createLabel({
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
color: '#000',
font: {
fontSize: 100,
- fontFamily: 'FontAwesome'
+ fontFamily: os({
+ iphone : 'FontAwesome',
+ ipad : 'FontAwesome',
+ android : 'fontawesome-webfont'
+ })
},
textAlign: 'center',
text: fontawesome.icon('github')
});
- window.add(octocatLabel);
+ wrapView.add(octocatLabel);
var baloonLabel = Ti.UI.createLabel({
- top: 150,
+ top: 20,
right: 30,
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: '#000',
font: {
fontSize: 100,
- fontFamily: 'FontAwesome'
+ fontFamily: os({
+ iphone : 'FontAwesome',
+ ipad : 'FontAwesome',
+ android : 'fontawesome-webfont'
+ })
},
text: fontawesome.icon('commentAlt')
});
- window.add(baloonLabel);
+ wrapView.add(baloonLabel);
var awesomeLabel = Ti.UI.createLabel({
- top: 26,
+ top: 45,
+ right: 43,
font: {
fontSize: 14,
fontWeight: 'bold'
},
+ color : 'black',
text: 'Awesome!'
});
- baloonLabel.add(awesomeLabel);
-
+ wrapView.add(awesomeLabel);
+
window.open();
})();
View
@@ -4,7 +4,7 @@
<target device="mobileweb">false</target>
<target device="iphone">true</target>
<target device="ipad">false</target>
- <target device="android">false</target>
+ <target device="android">true</target>
<target device="blackberry">false</target>
</deployment-targets>
<sdk-version>2.0.1.GA2</sdk-version>
@@ -36,7 +36,11 @@
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
- <android xmlns:android="http://schemas.android.com/apk/res/android"/>
+ <android xmlns:android="http://schemas.android.com/apk/res/android">
+ <manifest>
+ <supports-screens android:anyDensity="false"/>
+ </manifest>
+ </android>
<mobileweb>
<precache/>
<splash>

0 comments on commit f2c3b28

Please sign in to comment.