Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js
This file contains hidden or 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
| /** | |
| * @method slideIn | |
| * Makes the specified view appear using a "slide-in" animation, it will automatically | |
| * detect where the view is offscreen and bring it into the user's vison. | |
| * @param {Titanium.UI.View} view View to animate. | |
| * @param {Number} duration Fade duration in milliseconds. | |
| * @param {function()} [finishCallback] Callback function, invoked after the popIn completes. | |
| */ | |
| exports.slideIn = function (view, duration, finishCallback) { | |
UPDATE: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets or an alloy.ymk using:
task("pre:load", function(event, logger) {
require('ticons').assets();
});
This file contains hidden or 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
| // For iOS7 only, set the window's top to 20 so they start under the status bar. | |
| Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0; |
This file contains hidden or 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
| Alloy.isTablet = Alloy.isTablet || (Ti.Platform.model.search(/ipad/i) > -1); |
This file contains hidden or 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
| <Alloy> | |
| <Window module="xp.ui"> | |
| <Label>Hello World</Label> | |
| </Window> | |
| </Alloy> |
This file contains hidden or 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
| ## | |
| ## Build an Appcelerator Android Module | |
| ## Then copy it to the default module directory | |
| ## | |
| ## (c) Napp ApS | |
| ## Mads Møller | |
| ## | |
| ## HOW TO GUIDE |
This file contains hidden or 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
| // There is no direct way of binding angular to elements onload event as commonly the HTML elements onload="" attribute looks into the | |
| // Javascript global name space (window.*) which is a big no-no. It used to be the norm back in the day of how to do things but with | |
| // modern frameworks like AngularJs and the such the approach has changed a lot. | |
| // This is just one example (and by no means the only way) of how to get Angular behave nicely with HTML elements onload event. As | |
| // <iframe onload="test()"> looks into window.test for a callback we need to bound the onload event to look into provided angular scope | |
| // for the callback. | |
| // NOTE: Written in ES6 |
Demo of loading images using the Flickr API with IonicFramework
showing ui-router functionality of controller as for cleaner looking code.
A Pen by aaron k saunders on CodePen.