package org.apache.cordova.plugin;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import android.app.ProgressDialog;

public class ProgressIndicator extends CordovaPlugin {

    private ProgressDialog progressIndicator = null;

    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if (action.equals("show")) {
            String text = args.getString(0);
            show(text);
            callbackContext.success();
            return true;
        } else if (action.equals("hide")) {
            hide();
            callbackContext.success();
            return true;
        }

        return false;
    }

    /**
     * This show the ProgressDialog
     *
     * @param text - Message to display in the Progress Dialog
     */
    public void show(String text) {
        progressIndicator = ProgressDialog.show(this.cordova.getActivity(), "", text);
    }

    /**
     * This hide the ProgressDialog
     */
    public void hide() {
        if (progressIndicator != null) {
            progressIndicator.dismiss();
            progressIndicator = null;
        }
    }
}

@@ -21,21 +21,32 @@
 ordova.p
-lugin
+rogressindicator
 ;%0A%0Aimpor
@@ -326,16 +326,76 @@
  = null;
+%0A%09private static final String LOG_TAG = %22ProgressIndicator%22;
 %0A%0A    @O
@@ -569,38 +569,792 @@
     
-String text = args.getString(0
+show();%0A            callbackContext.success();%0A            return true;%0A        %7D else if (action.equals(%22showSimple%22)) %7B%0A            show();%0A            callbackContext.success();%0A            return true;%0A        %7D else if (action.equals(%22showSimpleWithLabel%22)) %7B%0A            String title = args.getString(1);%0A            show(title);%0A            callbackContext.success();%0A            return true;%0A        %7D else if (action.equals(%22showSimpleWithLabelDetail%22)) %7B%0A            String title = args.getString(1);%0A            String text = args.getString(2);%0A            show(title, text, true);%0A            callbackContext.success();%0A            return true;%0A        %7D else if (action.equals(%22showText%22)) %7B%0A            String title = args.getString(1);%0A%09%09%09String text = args.getString(2
 );%0A 
@@ -1370,19 +1370,33 @@
   show(t
-ext
+itle, text, false
 );%0A     
@@ -1587,24 +1587,188 @@
 e;%0A        %7D
+ else %7B%0A            callbackContext.error(%22Not supported call. On Android we only support show, showSimple, showSimpleWithLabel and showSimpleWithLabelDetail%22);%0A%09%09%7D
 %0A%0A        re
@@ -1778,32 +1778,285 @@
 n false;%0A    %7D%0A%0A
+    /**%0A     * This show the ProgressDialog%0A     *%0A     * @param text - Message to display in the Progress Dialog%0A     */%0A    public void show() %7B%0A        progressIndicator = new ProgressDialog(cordova.getActivity());%0A%09%09progressIndicator.show();%0A    %7D%0A%0A
     /**%0A     * T
@@ -2224,16 +2224,20 @@
 icator =
+ new
  Progres
@@ -2247,50 +2247,487 @@
 alog
-.show(this.cordova.getActivity(), %22%22, text
+(cordova.getActivity());%0A%09%09progressIndicator.setTitle(text);%0A%09%09progressIndicator.show();%0A    %7D%0A%0A    /**%0A     * This show the ProgressDialog%0A     *%0A     * @param text - Message to display in the Progress Dialog%0A     */%0A    public void show(String title, String detail, Boolean withTitle) %7B%0A        progressIndicator = new ProgressDialog(cordova.getActivity());%0A%09%09if(withTitle)%0A%09%09%09progressIndicator.setTitle(title);%0A%09%09progressIndicator.setMessage(detail);%0A%09%09progressIndicator.show(
 );%0A 

Update ProgressIndicator.java