Go Ahead, Fork Us!

We created a GitHub account to host all our freebie scripts and apps. To get things started we added our first freebie… a Titanium Mobile module called Indicator.js.

This module gives your app a simple indicator modal complete with spinner and message. You can size, position and update the message as you see fit.

Copy the module file to your project Resources folder. You can include it in your app using the require function:

var myIndicator = require('Indicator');

Then display the indicator modal when you need it:

// display with default settings
myIndicator.show();

And hide it when your done:

myIndicator.hide();

The show() method accepts a settings object to adjust the modal. Here’s an example of each setting:

myIndicator.show({
  message : "One Sec...",
  width : 100,
  height : 100,
  top : 50,
  bottom : 50,
  left : 50,
  right : 50
});

The size and position settings work the same as you would expect in a Titanium view or window. Currently this module will only work for iOS apps but we will update with Android support soon.

Enjoy!