Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23538] Refactor new project-templates #8073

Merged
merged 3 commits into from
Jul 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/app/default/template/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2008-2013 Appcelerator, Inc.
Copyright 2008-2016 Appcelerator, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion templates/app/default/template/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Stuff our legal folk make us say:
Appcelerator, Appcelerator Titanium and associated marks and logos are
trademarks of Appcelerator, Inc.

Titanium is Copyright (c) 2008-2013 by Appcelerator, Inc. All Rights Reserved.
Titanium is Copyright (c) 2008-2016 by Appcelerator, Inc. All Rights Reserved.

Titanium is licensed under the Apache Public License (Version 2). Please
see the LICENSE file for the full license.
Expand Down
Binary file removed templates/app/default/template/Resources/KS_nav_ui.png
Binary file not shown.
Binary file not shown.
113 changes: 50 additions & 63 deletions templates/app/default/template/Resources/app.js
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.