Search in sources :

Example 46 with ProgressDialog

use of android.app.ProgressDialog in project openkit-android by OpenKit.

the class WebDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setOnCancelListener(new OnCancelListener() {

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            sendCancelToListener();
        }
    });
    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) {
            sendCancelToListener();
            WebDialog.this.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 47 with ProgressDialog

use of android.app.ProgressDialog in project android-crop by jdamcd.

the class CropUtil method startBackgroundJob.

public static void startBackgroundJob(MonitoredActivity activity, String title, String message, Runnable job, Handler handler) {
    // Make the progress dialog uncancelable, so that we can guarantee
    // the thread will be done before the activity getting destroyed
    ProgressDialog dialog = ProgressDialog.show(activity, title, message, true, false);
    new Thread(new BackgroundJob(activity, job, dialog, handler)).start();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 48 with ProgressDialog

use of android.app.ProgressDialog in project okhttp-OkGo by jeasonlzy.

the class BaseActivity method showLoading.

public void showLoading() {
    if (dialog != null && dialog.isShowing())
        return;
    dialog = new ProgressDialog(this);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setMessage("请求网络中...");
    dialog.show();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 49 with ProgressDialog

use of android.app.ProgressDialog in project okhttp-OkGo by jeasonlzy.

the class DialogCallback method initDialog.

private void initDialog(Activity activity) {
    dialog = new ProgressDialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setMessage("请求网络中...");
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 50 with ProgressDialog

use of android.app.ProgressDialog in project Klyph by jonathangerbaud.

the class WebDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setOnCancelListener(new OnCancelListener() {

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            sendCancelToListener();
        }
    });
    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) {
            sendCancelToListener();
            WebDialog.this.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)

Aggregations

ProgressDialog (android.app.ProgressDialog)266 DialogInterface (android.content.DialogInterface)47 Intent (android.content.Intent)23 View (android.view.View)21 File (java.io.File)19 TextView (android.widget.TextView)13 SuppressLint (android.annotation.SuppressLint)12 Handler (android.os.Handler)12 FrameLayout (android.widget.FrameLayout)12 ArrayList (java.util.ArrayList)12 IOException (java.io.IOException)11 JSONObject (org.json.JSONObject)10 Uri (android.net.Uri)9 LinearLayout (android.widget.LinearLayout)9 OnCancelListener (android.content.DialogInterface.OnCancelListener)8 Display (android.view.Display)8 Activity (android.app.Activity)7 Dialog (android.app.Dialog)7 ImageView (android.widget.ImageView)7 List (java.util.List)7