Skip to content

Instantly share code, notes, and snippets.

@csemrm
Created December 14, 2013 13:22
Show Gist options
  • Save csemrm/7959066 to your computer and use it in GitHub Desktop.
Save csemrm/7959066 to your computer and use it in GitHub Desktop.
iPhone 5 Assets To use assets specific to the new iPhone 5 screen (1136 x 640 pixels), add the suffix -568h@2x to the asset filename, for example, Resources/iphone/myimage-568h@2x.png. Previously, only the splash screen file, Default.png, supported this suffix.
var LoginOnBoarding1Module = require('Mn_LoginOnBoarding1View');
var loginOnBoarding1View = new LoginOnBoarding1Module();
var LoginOnBoarding2Module = require('Mn_LoginOnBoarding2View');
var loginOnBoarding2View = new LoginOnBoarding2Module();
var LoginOnBoarding3Module = require('Mn_LoginOnBoarding3View');
var loginOnBoarding3View = new LoginOnBoarding3Module();
var LoginOnBoarding4Module = require('Mn_LoginOnBoarding4View');
var loginOnBoarding4View = new LoginOnBoarding4Module();
var LoginOnBoarding5Module = require('Mn_LoginOnBoarding5View');
var loginOnBoarding5View = new LoginOnBoarding5Module();
var win = Ti.UI.createWindow();
var view1 = Ti.UI.createView({
backgroundColor : '#123'
});
var view2 = Ti.UI.createView({
backgroundColor : '#246'
});
var view3 = Ti.UI.createView({
backgroundColor : '#48b'
});
var view4 = Ti.UI.createView({
backgroundColor : 'red'
});
var view5 = Ti.UI.createView({
backgroundColor : 'green'
});
view1.add(loginOnBoarding1View);
view2.add(loginOnBoarding2View);
view3.add(loginOnBoarding3View);
view4.add(loginOnBoarding4View);
view5.add(loginOnBoarding5View);
var scrollableView = Ti.UI.createScrollableView({
views : [view1, view2, view3, view4, view5],
showPagingControl : true
});
win.add(scrollableView);
win.open();
function LoginOnBoarding1View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
//create component instance
var self = Ti.UI.createImageView({
left : 0,
top : 0,
width : '100%',
image : 'images/onboarding-1.png',
zIndex : 0,
});
var firstline1YPos = 275;
var firstline2YPos = 272;
var descriptionYPos = 315;
if (iphone5Flag) {
firstline1YPos = 305;
firstline2YPos = 302;
descriptionYPos = 345;
}
var firstline1 = Ti.UI.createLabel({
text : L('Welcome to'),
left : 44,
top : firstline1YPos,
color : '#87878f',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(firstline1);
//7e828c noonswoon
var firstline2 = Ti.UI.createLabel({
text : 'noonswoon',
left : 165,
top : firstline2YPos,
color : '#7e828c',
font : {
fontWeight : 'bold',
fontSize : 24
},
zIndex : 3,
});
self.add(firstline2);
var description2 = Ti.UI.createLabel({
text : L('Love is in the App'),
center : {
x : '50%',
y : descriptionYPos
}, //x:67
color : '#4e5866',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(description2);
return self;
};
module.exports = LoginOnBoarding1View;
function loginOnBoarding2View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
//create component instance
var self = Ti.UI.createImageView({
left : 0,
top : 0,
width : '100%',
image : 'images/onboarding-2.png',
zIndex : 0,
});
var firstline1YPos = 275;
var firstline2YPos = 272;
var descriptionYPos = 315;
if (iphone5Flag) {
firstline1YPos = 305;
firstline2YPos = 302;
descriptionYPos = 345;
}
var firstline1 = Ti.UI.createLabel({
text : L('Welcome to'),
left : 44,
top : firstline1YPos,
color : '#87878f',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(firstline1);
//7e828c noonswoon
var firstline2 = Ti.UI.createLabel({
text : 'noonswoon',
left : 165,
top : firstline2YPos,
color : '#7e828c',
font : {
fontWeight : 'bold',
fontSize : 24
},
zIndex : 3,
});
self.add(firstline2);
var description2 = Ti.UI.createLabel({
text : L('Love is in the App'),
center : {
x : '50%',
y : descriptionYPos
}, //x:67
color : '#4e5866',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(description2);
return self;
};
module.exports = loginOnBoarding2View;
function loginOnBoarding3View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
//create component instance
var self = Ti.UI.createImageView({
left : 0,
top : 0,
width : '100%',
image : 'images/onboarding-3.png',
zIndex : 0,
});
var firstline1YPos = 275;
var firstline2YPos = 272;
var descriptionYPos = 315;
if (iphone5Flag) {
firstline1YPos = 305;
firstline2YPos = 302;
descriptionYPos = 345;
}
var firstline1 = Ti.UI.createLabel({
text : L('Welcome to'),
left : 44,
top : firstline1YPos,
color : '#87878f',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(firstline1);
//7e828c noonswoon
var firstline2 = Ti.UI.createLabel({
text : 'noonswoon',
left : 165,
top : firstline2YPos,
color : '#7e828c',
font : {
fontWeight : 'bold',
fontSize : 24
},
zIndex : 3,
});
self.add(firstline2);
var description2 = Ti.UI.createLabel({
text : L('Love is in the App'),
center : {
x : '50%',
y : descriptionYPos
}, //x:67
color : '#4e5866',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(description2);
return self;
};
module.exports = loginOnBoarding3View;
function loginOnBoarding4View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
//create component instance
var self = Ti.UI.createImageView({
left : 0,
top : 0,
width : '100%',
image : 'images/onboarding-4.png',
zIndex : 0,
});
var firstline1YPos = 275;
var firstline2YPos = 272;
var descriptionYPos = 315;
if (iphone5Flag) {
firstline1YPos = 305;
firstline2YPos = 302;
descriptionYPos = 345;
}
var firstline1 = Ti.UI.createLabel({
text : L('Welcome to'),
left : 44,
top : firstline1YPos,
color : '#87878f',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(firstline1);
//7e828c noonswoon
var firstline2 = Ti.UI.createLabel({
text : 'noonswoon',
left : 165,
top : firstline2YPos,
color : '#7e828c',
font : {
fontWeight : 'bold',
fontSize : 24
},
zIndex : 3,
});
self.add(firstline2);
var description2 = Ti.UI.createLabel({
text : L('Love is in the App'),
center : {
x : '50%',
y : descriptionYPos
}, //x:67
color : '#4e5866',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(description2);
return self;
};
module.exports = loginOnBoarding4View;
function loginOnBoarding5View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
alert(iphone5Flag);
//create component instance
var self = Ti.UI.createImageView({
left : 0,
top : 0,
width : '100%',
image : 'images/onboarding-5.png',
zIndex : 0,
});
var firstline1YPos = 275;
var firstline2YPos = 272;
var descriptionYPos = 315;
if (iphone5Flag) {
firstline1YPos = 305;
firstline2YPos = 302;
descriptionYPos = 345;
}
var firstline1 = Ti.UI.createLabel({
text : L('Welcome to'),
left : 44,
top : firstline1YPos,
color : '#87878f',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(firstline1);
//7e828c noonswoon
var firstline2 = Ti.UI.createLabel({
text : 'noonswoon',
left : 165,
top : firstline2YPos,
color : '#7e828c',
font : {
fontWeight : 'bold',
fontSize : 24
},
zIndex : 3,
});
self.add(firstline2);
var description2 = Ti.UI.createLabel({
text : L('Love is in the App'),
center : {
x : '50%',
y : descriptionYPos
}, //x:67
color : '#4e5866',
font : {
fontWeight : 'bold',
fontSize : 20
},
zIndex : 3,
});
self.add(description2);
return self;
};
module.exports = loginOnBoarding5View;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment