-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8073 from hansemannn/TIMOB-23538
[TIMOB-23538] Refactor new project-templates
- Loading branch information
Showing
11 changed files
with
52 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,51 @@ | ||
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | ||
Titanium.UI.setBackgroundColor('#000'); | ||
|
||
// create tab group | ||
var tabGroup = Titanium.UI.createTabGroup(); | ||
|
||
|
||
// | ||
// create base UI tab and root window | ||
// | ||
var win1 = Titanium.UI.createWindow({ | ||
title:'Tab 1', | ||
backgroundColor:'#fff' | ||
}); | ||
var tab1 = Titanium.UI.createTab({ | ||
icon:'KS_nav_views.png', | ||
title:'Tab 1', | ||
window:win1 | ||
}); | ||
|
||
var label1 = Titanium.UI.createLabel({ | ||
color:'#999', | ||
text:'I am Window 1', | ||
font:{fontSize:20,fontFamily:'Helvetica Neue'}, | ||
textAlign:'center', | ||
width:'auto' | ||
}); | ||
|
||
win1.add(label1); | ||
|
||
// | ||
// create controls tab and root window | ||
// | ||
var win2 = Titanium.UI.createWindow({ | ||
title:'Tab 2', | ||
backgroundColor:'#fff' | ||
}); | ||
var tab2 = Titanium.UI.createTab({ | ||
icon:'KS_nav_ui.png', | ||
title:'Tab 2', | ||
window:win2 | ||
}); | ||
|
||
var label2 = Titanium.UI.createLabel({ | ||
color:'#999', | ||
text:'I am Window 2', | ||
font:{fontSize:20,fontFamily:'Helvetica Neue'}, | ||
textAlign:'center', | ||
width:'auto' | ||
}); | ||
|
||
win2.add(label2); | ||
|
||
|
||
|
||
// | ||
// add tabs | ||
// | ||
tabGroup.addTab(tab1); | ||
tabGroup.addTab(tab2); | ||
|
||
|
||
// open tab group | ||
/** | ||
* Set a global background-color (used for iOS) | ||
*/ | ||
Ti.UI.setBackgroundColor("#fff"); | ||
|
||
/** | ||
* Create a new `Ti.UI.TabGroup`. | ||
*/ | ||
var tabGroup = Ti.UI.createTabGroup(); | ||
|
||
/** | ||
* Add the two created tabs to the tabGroup object. | ||
*/ | ||
tabGroup.addTab(createTab("Tab 1", "I am Window 1", "assets/images/tab1.png")); | ||
tabGroup.addTab(createTab("Tab 2", "I am Window 2", "assets/images/tab2.png")); | ||
|
||
/** | ||
* Open the tabGroup | ||
*/ | ||
tabGroup.open(); | ||
|
||
/** | ||
* Creates a new Tab and configures it. | ||
* | ||
* @param {String} title The title used in the `Ti.UI.Tab` and it's included `Ti.UI.Window` | ||
* @param {String} message The title displayed in the `Ti.UI.Label` | ||
* @return {String} icon The icon used in the `Ti.UI.Tab` | ||
*/ | ||
function createTab(title, message, icon) { | ||
var win = Ti.UI.createWindow({ | ||
title: title, | ||
backgroundColor: '#fff' | ||
}); | ||
|
||
var label = Ti.UI.createLabel({ | ||
text: message, | ||
font: { | ||
fontSize: 20 | ||
} | ||
}); | ||
|
||
win.add(label); | ||
|
||
var tab = Ti.UI.createTab({ | ||
title: title, | ||
icon: icon, | ||
window: win | ||
}); | ||
|
||
return tab; | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.