Search in sources :

Example 16 with ProgressDialog

use of android.app.ProgressDialog in project phonegap-facebook-plugin by Wizcorp.

the class WebDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    spinner = new ProgressDialog(getContext());
    spinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    spinner.setMessage(getContext().getString(R.string.com_facebook_loading));
    spinner.setOnCancelListener(new OnCancelListener() {

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            dismiss();
        }
    });
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    contentFrameLayout = new FrameLayout(getContext());
    // First calculate how big the frame layout should be
    calculateSize();
    getWindow().setGravity(Gravity.CENTER);
    // resize the dialog if the soft keyboard comes up
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    /* Create the 'x' image, but don't add to the contentFrameLayout layout yet
         * at this point, we only need to know its drawable width and height
         * to place the webview
         */
    createCrossImage();
    /* Now we know 'x' drawable width and height,
         * layout the webview and add it the contentFrameLayout layout
         */
    int crossWidth = crossImageView.getDrawable().getIntrinsicWidth();
    setUpWebView(crossWidth / 2 + 1);
    /* Finally add the 'x' image to the contentFrameLayout layout and
        * add contentFrameLayout to the Dialog view
        */
    contentFrameLayout.addView(crossImageView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    setContentView(contentFrameLayout);
}
Also used : DialogInterface(android.content.DialogInterface) FrameLayout(android.widget.FrameLayout) ProgressDialog(android.app.ProgressDialog) SuppressLint(android.annotation.SuppressLint)

Example 17 with ProgressDialog

use of android.app.ProgressDialog in project actor-platform by actorapp.

the class BaseActivity method execute.

// Executions
public <T> void execute(Command<T> cmd, int title, final CommandCallback<T> callback) {
    final ProgressDialog progressDialog = new ProgressDialog(this);
    progressDialog.setMessage(getString(title));
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
    cmd.start(new CommandCallback<T>() {

        @Override
        public void onResult(T res) {
            dismissDialog(progressDialog);
            callback.onResult(res);
        }

        @Override
        public void onError(Exception e) {
            dismissDialog(progressDialog);
            callback.onError(e);
        }
    });
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 18 with ProgressDialog

use of android.app.ProgressDialog in project actor-platform by actorapp.

the class BaseFragment method execute.

public <T> Promise<T> execute(Promise<T> promise, int title) {
    final ProgressDialog dialog = ProgressDialog.show(getContext(), "", getString(title), true, false);
    promise.then(new Consumer<T>() {

        @Override
        public void apply(T t) {
            dismissDialog(dialog);
        }
    }).failure(new Consumer<Exception>() {

        @Override
        public void apply(Exception e) {
            dismissDialog(dialog);
        }
    });
    return promise;
}
Also used : Consumer(im.actor.runtime.function.Consumer) ProgressDialog(android.app.ProgressDialog)

Example 19 with ProgressDialog

use of android.app.ProgressDialog in project Jota-Text-Editor-old by jiro-aqua.

the class TextLoadTask method onPreExecute.

@Override
protected void onPreExecute() {
    super.onPreExecute();
    if (mFileLoadListener != null) {
        mFileLoadListener.onPreFileLoad();
    }
    mProgressDialog = new ProgressDialog(mActivity);
    //        mProgressDialog.setTitle(R.string.spinner_message);
    mProgressDialog.setMessage(mActivity.getString(R.string.spinner_message));
    mProgressDialog.setIndeterminate(true);
    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    mProgressDialog.setCancelable(false);
    mProgressDialog.show();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 20 with ProgressDialog

use of android.app.ProgressDialog in project Jota-Text-Editor-old by jiro-aqua.

the class TextSaveTask method onPreExecute.

@Override
protected void onPreExecute() {
    super.onPreExecute();
    if (mPreProc != null) {
        mPreProc.run();
    }
    try {
        mProgressDialog = new ProgressDialog(mActivity);
        // mProgressDialog.setTitle(R.string.spinner_message);
        mProgressDialog.setMessage(mActivity.getString(R.string.spinner_message));
        mProgressDialog.setIndeterminate(true);
        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        mProgressDialog.setCancelable(false);
        mProgressDialog.show();
    } catch (Exception e) {
        mProgressDialog = null;
    }
}
Also used : ProgressDialog(android.app.ProgressDialog)

Aggregations

ProgressDialog (android.app.ProgressDialog)247 DialogInterface (android.content.DialogInterface)43 Intent (android.content.Intent)20 View (android.view.View)17 File (java.io.File)17 Handler (android.os.Handler)12 FrameLayout (android.widget.FrameLayout)12 TextView (android.widget.TextView)10 IOException (java.io.IOException)10 JSONObject (org.json.JSONObject)10 LinearLayout (android.widget.LinearLayout)9 ArrayList (java.util.ArrayList)9 SuppressLint (android.annotation.SuppressLint)8 Display (android.view.Display)8 Activity (android.app.Activity)7 Uri (android.net.Uri)7 AsyncTask (android.os.AsyncTask)7 Bundle (android.os.Bundle)6 KeyEvent (android.view.KeyEvent)6 ImageView (android.widget.ImageView)6