Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit 47b4237fcb46a14db24572f9f9cb8e33e1100613 Jon Alter committed Mar 30, 2011
1 CHANGELOG.txt
@@ -0,0 +1 @@
+Place your change log text here. This file will be incorporated with your app at package time.
219 LICENSE
@@ -0,0 +1,219 @@
+Copyright 2009 Appcelerator, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ (or the full text of the license is below)
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
1 LICENSE.txt
@@ -0,0 +1 @@
+Place your license text here. This file will be incorporated with your app at package time.
25 README.md
@@ -0,0 +1,25 @@
+# Titanium Mobile - The Kitchen Sink iPad
+
+This project includes a wide variety of the APIs available in Titanium Mobile. For more,
+head out to the [Appcelerator Developer Center](http://developer.appcelerator.com).
+
+# NOTE TO VIEWERS
+Using one JavaScript file per window in an application, while occasionally useful, is not considered a best practice. It is done in the Kitchen Sink so we can have a "clean slate" for every API demo. In a real application, you would probably use many fewer execution contexts, probably just the root context defined by app.js - for a demo of this approach in a more "real life" app, check out [Tweetanium](http://github.com/appcelerator/Tweetanium).
+
+# WINDOWS USERS
+
+Please place the Kitchen Sink demo in your user folder or a similarly shallow directory - windows' command line file path lengths cause problems with our build scripts.
+
+# TROUBLESHOOTING
+
+If the Kitchen Sink doesn't work out of the box for you, please [follow these steps outlined on our community Q&A](http://developer.appcelerator.com/question/53821/kitchen-sink-wont-run-what-do-i-do).
+
+---
+
+Appcelerator, Appcelerator Titanium and associated marks and logos are
+trademarks of Appcelerator, Inc.
+
+Titanium is Copyright (c) 2009-2010 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.
83 Resources/app.js
@@ -0,0 +1,83 @@
+Ti.include( 'split_view_nav.js','split_view_plain.js', 'nav_controller.js','main_tests.js' );
+
+var win = Ti.UI.createWindow();
+
+var l = Ti.UI.createLabel({
+ text:'Split Views cannot be closed, so if you run any of the first 3 tests, you will have to re-start the app.',
+ color:'#888',
+ font:{fontSize:20},
+ height:'auto',
+ width:'auto',
+ left:20,
+ right:20,
+ top:10
+});
+win.add(l);
+
+var b1 = Ti.UI.createButton({
+ title:'Open Main Tests',
+ width:300,
+ height:50,
+ top:100
+});
+b1.addEventListener('click', function()
+{
+ MainTests.open();
+});
+win.add(b1);
+
+var b2 = Ti.UI.createButton({
+ title:'Split View - Plain',
+ width:300,
+ height:50,
+ top:170
+});
+b2.addEventListener('click', function()
+{
+ SplitViewPlain.open();
+});
+win.add(b2);
+
+var b3 = Ti.UI.createButton({
+ title:'Split View w/Nav Group',
+ width:300,
+ height:50,
+ top:240
+});
+b3.addEventListener('click', function()
+{
+ SplitViewNav.open();
+});
+win.add(b3);
+
+var b4 = Ti.UI.createButton({
+ title:'Nav Group (Standalone)',
+ width:300,
+ height:50,
+ top:310
+});
+b4.addEventListener('click', function()
+{
+ NavController.open();
+});
+win.add(b4);
+
+var b5= Ti.UI.createButton({
+ title:'Fixed Orientation',
+ width:300,
+ height:50,
+ top:310
+});
+b5.addEventListener('click', function()
+{
+ var w = Ti.UI.createWindow({backgroundColor:'#fff'});
+ var l = Ti.UI.createLabel({text:'I should only be in Landscape'});
+ w.add(l);
+ w.orientationModes = [
+ Titanium.UI.LANDSCAPE_LEFT,
+ Titanium.UI.LANDSCAPE_RIGHT,
+ ];
+ w.open();
+});
+win.add(b5);
+win.open();
BIN Resources/default_app_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Resources/iphone/Default-Landscape.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Resources/iphone/Default-Portrait.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Resources/iphone/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Resources/iphone/appicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 Resources/main_tests.js
@@ -0,0 +1,85 @@
+MainTests = {};
+
+Ti.include('popover.js','video.js','option_dialog.js');
+
+Popover.init();
+Video.init();
+OptionDialog.init();
+
+// WINDOWS
+MainTests.masterWindow = Ti.UI.createWindow({
+ barColor:'#111',
+ title:'Test List',
+ backgroundColor:'#fff'
+});
+MainTests.detailWindow = Ti.UI.createWindow({
+ barColor:'#111',
+ title:'Test Detail',
+ backgroundColor:'#fff'
+});
+
+// MASTER NAV GROUP
+MainTests.masterNav = Ti.UI.iPhone.createNavigationGroup({
+ window:MainTests.masterWindow
+});
+
+// DETAIL NAV GROUP
+MainTests.detailNav = Ti.UI.iPhone.createNavigationGroup({
+ window:MainTests.detailWindow
+});
+
+// SPLIT VIEW
+MainTests.splitView = Titanium.UI.iPad.createSplitWindow({
+ masterView:MainTests.masterNav,
+ detailView:MainTests.detailNav,
+});
+
+// SPLIT VIEW EVENT LISTENER
+MainTests.splitView.addEventListener('visible',function(e)
+{
+ Ti.API.info('HERE ' + e.view + ' button ' + e.button)
+ // show master list when in detail mode via left nav button
+ if (e.view == 'detail')
+ {
+ e.button.title = "Show List";
+ MainTests.detailWindow.leftNavButton = e.button;
+ }
+
+ // hide it
+ else if (e.view == 'master')
+ {
+ MainTests.detailWindow.leftNavButton = null;
+ }
+});
+
+// MASTER TABLE VIEW
+MainTests.tableVewData = [
+ {title:'Popovers', v:Popover.view},
+ {title:'Option Dialogs', v:OptionDialog.view},
+ {title:'Embedded Video', v:Video.view},
+];
+
+MainTests.tableView = Ti.UI.createTableView({
+ data:MainTests.tableVewData
+});
+
+MainTests.tableView.addEventListener('click', function(e)
+{
+ MainTests.detailWindow.animate({view:e.rowData.v,transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
+});
+
+MainTests.masterWindow.add(MainTests.tableView);
+
+MainTests.button = Titanium.UI.createButton({
+ title:'Hello'
+});
+MainTests.button.addEventListener('click', function()
+{
+ alert('hello');
+});
+MainTests.detailWindow.rightNavButton = MainTests.button;
+
+MainTests.open = function()
+{
+ MainTests.splitView.open();
+};
BIN Resources/movie.mp4
Binary file not shown.
53 Resources/nav_controller.js
@@ -0,0 +1,53 @@
+NavController = {};
+
+NavController.mainWindow = Ti.UI.createWindow();
+
+// WINDOWS
+NavController.win = Ti.UI.createWindow({title:'Navigation Group',backgroundColor:'#336699'});
+
+// NAV GROUP
+NavController.navGroup = Ti.UI.iPhone.createNavigationGroup({
+ window:NavController.win
+});
+
+NavController.mainWindow.add(NavController.navGroup)
+
+// BUTTON
+NavController.button = Ti.UI.createButton({
+ title:'Open Window',
+ width:300,
+ height:50,
+ top:100
+});
+NavController.button.addEventListener('click', function()
+{
+ var w = Ti.UI.createWindow({
+ title:'New Window',
+ backgroundColor:'#fff'
+ });
+ var l = Ti.UI.createLabel({
+ textAlign:'center',
+ text:'New Window'
+ })
+ NavController.navGroup.open(w,{animated:true});
+});
+NavController.win.add(NavController.button);
+
+// CLOSE BUTTON
+NavController.closeButton = Ti.UI.createButton({
+ title:'Close Nav Group',
+ width:300,
+ height:50,
+ top:170
+});
+NavController.closeButton.addEventListener('click', function()
+{
+ NavController.mainWindow.close();
+});
+NavController.win.add(NavController.closeButton);
+
+NavController.open = function()
+{
+ Ti.API.info('IN OPEN')
+ NavController.mainWindow.open();
+};
48 Resources/option_dialog.js
@@ -0,0 +1,48 @@
+OptionDialog = {};
+OptionDialog.view = Ti.UI.createView();
+
+OptionDialog.init = function()
+{
+ var b1 = Ti.UI.createButton({
+ title:'Options Dialog 1',
+ height:50,
+ width:300,
+ top:100
+ });
+ OptionDialog.view.add(b1);
+
+ var dialog1 = Titanium.UI.createOptionDialog({
+ options:['Option 1', 'Option 2'],
+ title:'Select an Option'
+ });
+
+ // build first popover
+ b1.addEventListener('click', function()
+ {
+ dialog1.show({view:b1,animated:true});
+ });
+
+ var b2 = Ti.UI.createButton({
+ title:'Options Dialog 2',
+ height:50,
+ width:300,
+ top:170
+ });
+ OptionDialog.view.add(b2);
+
+ // NOTE: on iPad cancel button is not displayed since clicking outside of the dialog
+ // cancels the action (you can still track the button click though in the event listener)
+ var dialog2 = Titanium.UI.createOptionDialog({
+ options:['Option 1', 'Option 2', 'Option 3'],
+ destructive:1,
+ cancel:2,
+
+ });
+
+ // build first popover
+ b2.addEventListener('click', function()
+ {
+ dialog2.show({view:b2,animated:true});
+ });
+
+};
171 Resources/popover.js
@@ -0,0 +1,171 @@
+Popover = {};
+Popover.view = Ti.UI.createView();
+
+// arrow directions
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_UP
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_DOWN
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_RIGHT
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_ANY
+// Ti.UI.iPad.POPOVER_ARROW_DIRECTION_UNKNOWN
+
+Popover.init = function()
+{
+ var b1 = Ti.UI.createButton({
+ title:'Show Popover 1',
+ height:50,
+ width:300,
+ top:100
+ });
+ Popover.view.add(b1);
+
+
+ // build first popover
+ b1.addEventListener('click', function()
+ {
+ var close = Ti.UI.createButton({
+ title:'Close'
+ });
+ var canc = Ti.UI.createButton({
+ title:'Cancel'
+ });
+ canc.addEventListener('click', function()
+ {
+ popover.hide({animated:true});
+ });
+ close.addEventListener('click', function()
+ {
+ popover.hide({animated:true});
+ });
+ var popover = Ti.UI.iPad.createPopover({
+ width:200,
+ height:350,
+ title:'Table View',
+ rightNavButton:close,
+ leftNavButton:canc,
+ barColor:'#111'
+ });
+ var searchBar = Ti.UI.createSearchBar({top:0,height:44,barColor:'#333'});
+
+ var tableView = Ti.UI.createTableView({
+ data:[{title:'Option 1'},{title:'Option 3'},{title:'Option 2'}],
+ top:44,
+ height:300
+ });
+
+ popover.add(searchBar)
+ popover.add(tableView);
+
+ popover.show({
+ view:b1,
+ animated:true,
+ });
+
+ });
+
+ var b2 = Ti.UI.createButton({
+ title:'Show Popover 2',
+ height:50,
+ width:300,
+ top:170
+ });
+ Popover.view.add(b2);
+
+
+ // build first popover
+ b2.addEventListener('click', function()
+ {
+ var popover = Ti.UI.iPad.createPopover({
+ width:200,
+ height:200,
+ title:'Picker',
+ arrowDirection:Ti.UI.iPad.POPOVER_ARROW_DIRECTION_RIGHT
+ });
+ var picker = Ti.UI.createPicker();
+
+ var data = [
+ {title:'Bananas',fontSize:20},
+ {title:'Strawberries',fontSize:20},
+ {title:'Mangos',fontSize:20,selected:true},
+ {title:'Grapes',fontSize:20}
+ ];
+
+ picker.add(data);
+ picker.selectionIndicator = true;
+
+ popover.add(picker)
+ popover.show({
+ view:b2,
+ animated:true,
+ });
+
+ });
+
+ var b3 = Ti.UI.createButton({
+ title:'Show Popover 3',
+ height:50,
+ width:300,
+ top:240
+ });
+ Popover.view.add(b3);
+
+
+ // build first popover
+ b3.addEventListener('click', function()
+ {
+ var popover = Ti.UI.iPad.createPopover({
+ width:300,
+ height:300,
+ title:'Scrollable View',
+ arrowDirection:Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT
+ });
+
+ var view1 = Ti.UI.createView({
+ backgroundColor:'red'
+ });
+ var l1 = Ti.UI.createLabel({
+ text:'View 1',
+ color:'#fff',
+ width:'auto',
+ height:'auto'
+ });
+ view1.add(l1);
+
+ var view2 = Ti.UI.createView({
+ backgroundColor:'blue'
+ });
+ var l2 = Ti.UI.createLabel({
+ text:'View 2',
+ color:'#fff',
+ width:'auto',
+ height:'auto'
+ });
+ view2.add(l2);
+
+ var view3 = Ti.UI.createView({
+ backgroundColor:'green'
+ });
+ var l3 = Ti.UI.createLabel({
+ text:'View 3',
+ color:'#fff',
+ width:'auto',
+ height:'auto'
+ });
+ view3.add(l3);
+
+
+
+ var scrollView = Titanium.UI.createScrollableView({
+ views:[view1,view2,view3],
+ showPagingControl:true,
+ pagingControlHeight:30,
+ });
+
+ popover.add(scrollView)
+
+ popover.show({
+ view:b3,
+ });
+
+ });
+}
127 Resources/split_view_nav.js
@@ -0,0 +1,127 @@
+SplitViewNav = {};
+
+// WINDOWS
+SplitViewNav.masterWindow = Ti.UI.createWindow({title:'Master',backgroundColor:'red'});
+SplitViewNav.detailWindow = Ti.UI.createWindow({title:'Detail',backgroundColor:'#336699'});
+
+// MASTER NAV GROUP
+SplitViewNav.masterNav = Ti.UI.iPhone.createNavigationGroup({
+ window:SplitViewNav.masterWindow
+});
+
+// DETAIL NAV GROUP
+SplitViewNav.detailNav = Ti.UI.iPhone.createNavigationGroup({
+ window:SplitViewNav.detailWindow
+});
+
+// SPLIT VIEW
+SplitViewNav.splitView = Titanium.UI.iPad.createSplitWindow({
+ masterView:SplitViewNav.masterNav,
+ detailView:SplitViewNav.detailNav,
+});
+
+
+// MASTER BUTTON
+SplitViewNav.masterButton = Ti.UI.createButton({
+ title:'Open Window',
+ height:50,
+ width:200
+});
+SplitViewNav.masterButton.addEventListener('click', function()
+{
+ var w = Ti.UI.createWindow({backgroundColor:'#ff9900'});
+ var l = Ti.UI.createLabel({
+ text:'New Window',
+ color:'white',
+ textAlign:'center'
+ });
+ w.add(l)
+ w.addEventListener('blur', function() {
+ Titanium.UI.createAlertDialog({
+ title:'Master blur',
+ message:'You blurred the master window!'
+ }).show();
+ });
+ SplitViewNav.masterNav.open(w,{animated:true});
+});
+SplitViewNav.masterWindow.add(SplitViewNav.masterButton);
+
+// DETAIL BUTTON
+SplitViewNav.detailButton = Ti.UI.createButton({
+ title:'Open Window',
+ height:50,
+ width:200,
+ textAlign:'center'
+});
+SplitViewNav.detailButton.addEventListener('click', function()
+{
+ var w = Ti.UI.createWindow({backgroundColor:'#fff'});
+ var b = Ti.UI.createButton({
+ title:'Show modal',
+ width:150,
+ height:40
+ });
+ w.add(b);
+ b.addEventListener('click', function() {
+ var modal = Titanium.UI.createWindow({
+ backgroundColor:'#336699',
+ title:'Modal Window',
+ barColor:'black',
+ modal:true
+ });
+
+ var bb = Ti.UI.createButton({
+ title:'Dismiss modal',
+ width:150,
+ height:40
+ });
+ bb.addEventListener('click', function() {
+ modal.close();
+ });
+
+ modal.add(bb);
+ modal.open();
+ });
+
+ w.addEventListener('blur', function() {
+ Titanium.UI.createAlertDialog({
+ title:'Detail blur',
+ message:'You blurred the detail window!'
+ }).show();
+ });
+ SplitViewNav.detailNav.open(w,{animated:true});
+});
+SplitViewNav.detailWindow.add(SplitViewNav.detailButton);
+
+var done = Titanium.UI.createButton({
+ systemButton:Titanium.UI.iPhone.SystemButton.DONE
+});
+
+SplitViewNav.detailWindow.setRightNavButton(done);
+done.addEventListener('click',function()
+{
+ Titanium.UI.createAlertDialog({
+ title:'Clicked!',
+ message:'You clicked the right nav button!'
+ }).show();
+});
+
+
+SplitViewNav.open = function()
+{
+ Ti.API.info('in open for split view nav')
+ SplitViewNav.splitView.open();
+};
+
+SplitViewNav.splitView.addEventListener('visible', function(e) {
+ Ti.API.log('View: '+e.view);
+ if (e.view == 'detail') {
+ e.button.title = "Popover";
+ SplitViewNav.detailWindow.leftNavButton = e.button;
+ Ti.API.log('Set button');
+ }
+ else if (e.view == 'master') {
+ SplitViewNav.detailWindow.leftNavButton = null;
+ Ti.API.log('Removed button');
+ }
+});
62 Resources/split_view_plain.js
@@ -0,0 +1,62 @@
+SplitViewPlain = {};
+
+// WINDOWS
+SplitViewPlain.masterWindow = Ti.UI.createWindow({backgroundColor:'#ffffff'});
+SplitViewPlain.detailWindow = Ti.UI.createWindow({backgroundColor:'#336699'});
+
+// LABELS
+SplitViewPlain.masterLabel = Ti.UI.createLabel({
+ color:'#777',
+ font:{fontSize:20},
+ text:'Master Window (Landscape Only)',
+ textAlign:'center'
+});
+
+SplitViewPlain.masterWindow.add(SplitViewPlain.masterLabel);
+
+SplitViewPlain.modalButton = Ti.UI.createButton({
+ title:'Show modal',
+ width:150,
+ height:40
+});
+SplitViewPlain.detailWindow.add(SplitViewPlain.modalButton);
+SplitViewPlain.modalButton.addEventListener('click', function() {
+ var modal = Titanium.UI.createWindow({
+ backgroundColor:'#336699',
+ title:'Modal Window',
+ barColor:'black',
+ modal:true
+ });
+
+ var flexSpace = Titanium.UI.createButton({
+ systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
+ });
+
+ var bb = Ti.UI.createButton({
+ title:'Dismiss modal',
+ width:150,
+ height:40
+ });
+ bb.addEventListener('click', function() {
+ modal.close();
+ });
+
+ modal.add(bb);
+ modal.open();
+});
+
+// SPLIT VIEW
+SplitViewPlain.splitView = Titanium.UI.iPad.createSplitWindow({
+ masterView:SplitViewPlain.masterWindow,
+ detailView:SplitViewPlain.detailWindow,
+});
+
+SplitViewPlain.splitView.orientationModes = [
+ Titanium.UI.LANDSCAPE_LEFT,
+ Titanium.UI.LANDSCAPE_RIGHT,
+];
+
+SplitViewPlain.open = function()
+{
+ SplitViewPlain.splitView.open();
+};
20 Resources/video.js
@@ -0,0 +1,20 @@
+Video = {};
+Video.view = Ti.UI.createView();
+Video.videoObject = null;
+
+Video.init = function()
+{
+ Video.videoObject = Titanium.Media.createVideoPlayer({
+ contentURL:'movie.mp4',
+ backgroundColor:'#111',
+ movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
+ scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL,
+ top:100,
+ movieControlStyle:Titanium.Media.VIDEO_CONTROL_EMBEDDED,
+ height:300,
+ width:400,
+ autoplay:false
+ });
+
+ Video.view.add(Video.videoObject);
+};
BIN build/.DS_Store
Binary file not shown.
BIN build/android/.DS_Store
Binary file not shown.
8 build/android/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="lib" path="lib/titanium.jar"/>
+ <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="gen"/>
+</classpath>
6 build/android/.gitignore
@@ -0,0 +1,6 @@
+src
+lib
+bin
+res
+gen
+AndroidManifest.xml
33 build/android/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>KitchenSink</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
BIN build/iphone/.DS_Store
Binary file not shown.
11 build/iphone/.gitignore
@@ -0,0 +1,11 @@
+Classes
+tmp
+build
+headers
+lib
+Resources
+*.xcodeproj
+*.xcconfig
+main.m
+*.plist
+*.pch
8 manifest
@@ -0,0 +1,8 @@
+#appname: KitchenSink-iPad
+#publisher: kevin
+#url: http://www.appcelerator.com
+#image: appicon.png
+#appid: com.appcelerator.kitchensink.ipad
+#desc: undefined
+#type: ipad
+#guid: 63cc828c-d5c2-4c9b-9acb-ec390a370627
34 tiapp.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ti:app xmlns:ti="http://ti.appcelerator.org">
+ <id>com.appcelerator.kitchensink.ipad</id>
+ <name>KitchenSink-iPad</name>
+ <version>1.0</version>
+ <publisher>not specified</publisher>
+ <url>not specified</url>
+ <description>not specified</description>
+ <copyright>not specified</copyright>
+ <icon>appicon.png</icon>
+ <persistent-wifi>false</persistent-wifi>
+ <prerendered-icon>false</prerendered-icon>
+ <statusbar-style>default</statusbar-style>
+ <statusbar-hidden>false</statusbar-hidden>
+ <fullscreen>false</fullscreen>
+ <navbar-hidden>false</navbar-hidden>
+ <analytics>true</analytics>
+<guid>63cc828c-d5c2-4c9b-9acb-ec390a370627</guid>
+ <iphone>
+ <orientations device="iphone">
+ <orientation>Ti.UI.PORTRAIT</orientation>
+ </orientations>
+ <orientations device="ipad">
+ <orientation>Ti.UI.PORTRAIT</orientation>
+ <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
+ <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
+ <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
+ </orientations>
+ </iphone>
+ <android xmlns:android="http://schemas.android.com/apk/res/android">
+ </android>
+ <modules>
+ </modules>
+</ti:app>

0 comments on commit 47b4237

Please sign in to comment.
Something went wrong with that request. Please try again.