Skip to content

Instantly share code, notes, and snippets.

View giorgiopagnoni's full-sized avatar

Giorgio Pagnoni giorgiopagnoni

View GitHub Profile
@giorgiopagnoni
giorgiopagnoni / page.indicator.js
Last active March 9, 2017 03:38
Page indicator (circles, lines, squares...) for scrollableViews for Appcelerator Titanium (Android)
/*
* Simple page indicator for scrollableViews for Appcelerator Titanium (Android).
* To be added after the views have been set.
*
* var p = require('page.indicator');
* var options = { color: 'red' };
* var indicator = p.pageIndicator(myScrollableView, options);
*/
@giorgiopagnoni
giorgiopagnoni / remove.children.js
Last active August 29, 2015 14:21
Remove recursively all the children from a view in Appcelerator Titanium (Android)
/*
* Does this really help solve some memory leaks...?
*/
Alloy.Globals.removeChildren = function(view) {
if (view) {
if (view.length) {
// it's an array of views (eg. the views of a scrollableView)
for (var i = 0; i < view.length; i++) {
Alloy.Globals.removeChildren(view[i]);
}