Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A custom Progress View to use in your Titanium Appcelerator project

branch: master
README.markdown

Progress View

This is an progress view, to show some status of your application. You can set loading, success and error status.

With just three lines, you can show and hide you progress view from your application.

Usage

It's very simple to use this component. You have just to include the modules folder in your project and include the file progress.view.js in your Titanium project file.

See this example:

Ti.include("modules/progress.view.js");

var progressView = new ProgressView();

progressView.show({
    text:"Error message"
});

setTimeout(function() {
    progressView.hide();
}, 2000);

Window

If you are using an external window (url:...) you have not to set the window. The API will take the currentWindow to add the ProgressView. But, if you aren't using an external window you have to set the window when you instance a new ProgressView, like this example:

Ti.include("modules/progress.view.js");

var win = Ti.UI.createWindow({
    title: "Progress View"
});

var progressView = new ProgressView({
    window: win
});

Text Label

You can set a text to your progress view. The view will resize if needed. If you wanna change the text, you have just to use the method setTextLabel with the text.

Change properties

If you wanna change the text or the image of your progress view, you have not to hide and show another progress view. For this, you have to use the method change with the properties you want, like you created.

Images

I made two images in this project: success and error. To use them, you have to set the property with a BOOLEAN value. See the examples:

Ti.include("modules/progress.view.js");

var progressView = new ProgressView();

progressView.show({
    text:"Error message",
    error:true
});

setTimeout(function() {
    progressView.change({
        success:true
    });
}, 2000);

setTimeout(function() {
    progressView.hide();
}, 4000);

Credits

This project was based in the SVProgressHUD from @samvermette.

The images was made by @glyphish

Something went wrong with that request. Please try again.