Moved to: https://github.com/FokkeZB/UTiL/tree/master/share
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
| /* | |
| WildText CommonJS module for Appcelerator Titanium | |
| Create dynamic gradient filled text in your iOS Applications using this simple module. | |
| @params : text - String. The text for your label | |
| font - Font. Specify the font attributes for the label (defaults to standard size, weight and family), | |
| backgroundGradient - BackgroundGradient. Specify your backgroundGradient object (defaults to White to Black linear gradient), | |
| Top - Integer. Top property for your label, | |
| Left - Integer. Left Property for your Label, |
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
| "#wrapper": { | |
| // Set wrapper to adjust it's size to it's contents | |
| width: Ti.UI.SIZE, | |
| height: Ti.UI.SIZE, | |
| // Set stuff like borders and backgrounds on the wrapper | |
| backgroundColor: "red" | |
| } |
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
| var v = Ti.UI.createView(); | |
| var s = new require('spinner').Spinner( | |
| v, // View to spin | |
| 30 // Degrees to spin per millisecond | |
| ); // Auto-starts | |
| // Stop | |
| s.stop(); |
I like easy drop-in CommonJS libraries that need minimal configuration to perform common tasks.
This CommonJS library checks with Apple every X days to see if there's a new version available. If so, it asks the user if he/she would like to update and then opens the app in the App Store.
At minimum, the library requires no configuration at all and just a single line of code.
Look at advanced.js for all available options and methods.
Also check out my rating library:
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) { | |
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
| function transition(){ | |
| var self = Titanium.UI.createWindow({ | |
| backgroundColor:'#c9c9c9', | |
| }); | |
| var backs = Titanium.UI.createView({ | |
| backgroundImage:'/images/back1.png', | |
| top:-30, | |
| left:-30, | |
| bottom:0, | |
| right: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
| // This is an example of use. | |
| // Here we use the new Bearer Token thats make it possible to get tweets without user login | |
| // More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth | |
| // Full Codebird API is here: https://github.com/mynetx/codebird-js | |
| var Codebird = require("codebird"); | |
| var cb = new Codebird(); | |
| cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY'); | |
| var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null); |
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
| var get_file = function(url, callback) { | |
| var xhr = Ti.Network.createHTTPClient({ | |
| onload: function(e) { | |
| // this function is called when data is returned from the server and available for use | |
| // this.responseText holds the raw text return of the message (used for text/JSON) | |
| // this.responseXML holds any returned XML (including SOAP) | |
| // this.responseData holds any returned binary data | |
| console.log('downloaded '+ url); | |
| callback({ |