Example usage for android.app ProgressDialog ProgressDialog

List of usage examples for android.app ProgressDialog ProgressDialog

Introduction

In this page you can find the example usage for android.app ProgressDialog ProgressDialog.

Prototype

public ProgressDialog(Context context) 

Source Link

Document

Creates a Progress dialog.

Usage

From source file:com.netpace.expressit.activity.UploadImageStoryActivity.java

private void showProgressDialog() {
    dialog = new ProgressDialog(this);
    dialog.setMessage("uploading...");
    dialog.setCancelable(false);/* w w  w .  ja v  a 2  s  .  co m*/
    dialog.show();
}

From source file:org.openremote.android.console.AppSettingsActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setTitle(R.string.settings);/*from   w w w  .  j av a  2  s. c o m*/

    this.autoMode = AppSettingsModel.isAutoMode(AppSettingsActivity.this);

    // The main layout contains all application configuration items.
    LinearLayout mainLayout = new LinearLayout(this);
    mainLayout
            .setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    mainLayout.setOrientation(LinearLayout.VERTICAL);
    mainLayout.setBackgroundColor(0);
    mainLayout.setTag(R.string.settings);

    loadingPanelProgress = new ProgressDialog(this);

    // The scroll view contains appSettingsView, and make the appSettingsView can be scrolled.
    ScrollView scroll = new ScrollView(this);
    scroll.setVerticalScrollBarEnabled(true);
    scroll.setLayoutParams(
            new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1));
    appSettingsView = new LinearLayout(this);
    appSettingsView
            .setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    appSettingsView.setOrientation(LinearLayout.VERTICAL);

    appSettingsView.addView(createAutoLayout());
    appSettingsView.addView(createChooseControllerLabel());

    currentServer = "";
    if (autoMode) {
        appSettingsView.addView(constructAutoServersView());
    } else {
        appSettingsView.addView(constructCustomServersView());
    }
    appSettingsView.addView(createChoosePanelLabel());
    panelSelectSpinnerView = new PanelSelectSpinnerView(this);
    appSettingsView.addView(panelSelectSpinnerView);

    appSettingsView.addView(createCacheText());
    appSettingsView.addView(createClearImageCacheButton());
    appSettingsView.addView(createSSLLayout());
    scroll.addView(appSettingsView);

    mainLayout.addView(scroll);
    mainLayout.addView(createDoneAndCancelLayout());

    setContentView(mainLayout);
    initSSLState();
    addOnclickListenerOnDoneButton();
    addOnclickListenerOnCancelButton();
    progressLayout = (LinearLayout) findViewById(R.id.choose_controller_progress);

}

From source file:com.wenwen.chatuidemo.activity.AddContactActivity.java

/**
 * contact//from  w  w w .  j  av a2s .  co m
 * 
 * @param view
 */
public void addContact(View view) {
    if (DemoApplication.getInstance().getUserName().equals(nameText.getText().toString())) {
        startActivity(new Intent(this, AlertDialog.class).putExtra("msg", "?"));
        return;
    }
    final ProgressDialog pd = new ProgressDialog(AddContactActivity.this);
    pd.setMessage("...");
    RequestParams params = new RequestParams();
    DebugLog.i(TAG, "uid" + DemoApplication.getInstance().getUserUid());
    params.put("fromuid", DemoApplication.getInstance().getUserUid());
    params.put("touid", myUser.getAccount_id());
    params.put("flag", "1");
    HttpClientRequest.post(Urls.FRIENDSSET, params, 3000, new AsyncHttpResponseHandler() {
        @Override
        public void onStart() {
            // TODO Auto-generated method stub
            super.onStart();
            pd.show();
        }

        @Override
        public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
            // TODO Auto-generated method stub
            try {
                String res = new String(arg2);
                DebugLog.i(TAG, "" + res);
                JSONObject result = new JSONObject(res);
                switch (Integer.valueOf(result.getString("ret"))) {
                case 0:
                    Toast.makeText(AddContactActivity.this, "", Toast.LENGTH_SHORT).show();
                    break;
                case 1:
                    Toast.makeText(AddContactActivity.this, "?", Toast.LENGTH_SHORT).show();
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("myuser", myUser);
                    Intent data = new Intent();
                    data.putExtras(bundle);
                    setResult(Activity.RESULT_OK, data); // ???
                    finish();
                    break;
                case -2:
                    Toast.makeText(AddContactActivity.this, "??", Toast.LENGTH_SHORT).show();
                    break;
                default:
                    break;

                }
            } catch (NumberFormatException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        }

        @Override
        public void onFinish() {
            // TODO Auto-generated method stub
            super.onFinish();
            pd.dismiss();
        }

        @Override
        public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {
            // TODO Auto-generated method stub

        }
    });
}

From source file:fr.digitbooks.android.examples.chapitre08.RateDigitbooksActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case DIALOG_RATE_NULL: {
        return new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert)
                .setTitle(R.string.dialog_null_title).setMessage(getString(R.string.dialog_null_comment))
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        rateDigitbooks();
                        dismissDialog(DIALOG_RATE_NULL);
                    }/*from w  ww . j a va2  s .c o  m*/
                }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        dismissDialog(DIALOG_RATE_NULL);
                    }
                }).create();
    }
    case DIALOG_PROGRESS: {
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setMessage(getString(R.string.send_comment));
        dialog.setIndeterminate(true);
        dialog.setCancelable(false);
        return dialog;
    }
    }
    return null;
}

From source file:com.kakao.auth.authorization.authcode.KakaoWebViewDialog.java

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

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.argb(128, 0, 0, 0)));

    setOnCancelListener(new OnCancelListener() {
        @Override/*  ww  w .  j  a va2 s . co m*/
        public void onCancel(DialogInterface dialogInterface) {
            sendCancelToListenerIfNeeded();
        }
    });

    spinner = new ProgressDialog(getContext());
    spinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    //spinner.setMessage(getContext().getString(R.string.core_com_kakao_sdk_loading));
    spinner.setMessage("Loading");
    spinner.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            sendCancelToListenerIfNeeded();
            KakaoWebViewDialog.this.dismiss();
        }
    });

    contentFrameLayout = new FrameLayout(getContext());

    createCrossImage();
    int crossWidth = crossImageView.getDrawable().getIntrinsicWidth();
    setUpWebView(crossWidth / 2);

    contentFrameLayout.addView(crossImageView,
            new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    addContentView(contentFrameLayout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

    registerSmsReceiverIfNeeded();
}

From source file:org.webpki.mobile.android.proxy.BaseProxyActivity.java

public void showHeavyWork(final String message) {
    if (!user_aborted) {
        if (progress_display == null) {
            progress_display = new ProgressDialog(this);
            progress_display.setMessage(message);
            progress_display.setCanceledOnTouchOutside(false);
            progress_display.setCancelable(false);
            progress_display.setButton(DialogInterface.BUTTON_POSITIVE, "Cancel",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            conditionalAbort(message);
                        }/*w w w  .j ava2  s.  c  o m*/
                    });
            progress_display.show();
        } else {
            progress_display.setMessage(message);
        }
    }
}

From source file:cn.net_show.doctor.activity.AuthActivity.java

private void getProcessDialog() {
    pd = new ProgressDialog(this);//, R.style.dialog);
    pd.setCancelable(false);/* ww  w .j av  a  2 s.  co m*/
    pd.setCanceledOnTouchOutside(false);
    pd.setMessage("");
}

From source file:com.code.android.vibevault.FeaturedShowsScreen.java

/** Dialog creation method.
*
* Includes Thread bookkeeping to prevent not leaking Views on orientation changes.
*//*from   w  w w  . j a  va 2 s .  c o  m*/
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case VibeVault.RETRIEVING_DIALOG_ID:

        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setMessage("Retrieving Featured Shows...");
        return dialog;
    default:
        return super.onCreateDialog(id);
    }
}

From source file:com.bwash.bwashcar.activities.CompanyActivity.java

public void initData() {

    uploadManager = QiniuUtil.init();/* w  ww  .j  av a2  s  .co  m*/

    if (this.progressDialog == null) {
        this.progressDialog = new ProgressDialog(this);
        this.progressDialog.setCancelable(true);
        this.progressDialog.setIndeterminate(true);
        this.progressDialog.setCanceledOnTouchOutside(false);
    }

}

From source file:de.Maxr1998.xposed.maxlock.ui.settings.appslist.AppListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = (ViewGroup) inflater.inflate(R.layout.fragment_appslist, container, false);
    // Setup layout
    recyclerView = (RecyclerView) rootView.findViewById(R.id.app_list);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setAdapter(mAdapter);/* w  ww. j  a  va 2s  . co  m*/
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        inflater.inflate(R.layout.fast_scroller, rootView);
        fastScroller = (VerticalRecyclerViewFastScroller) rootView.findViewById(R.id.fast_scroller);
        fastScroller.setRecyclerView(recyclerView);
        recyclerView.setOnScrollListener(fastScroller.getOnScrollListener());
        scrollIndicator = (SectionTitleIndicator) rootView
                .findViewById(R.id.fast_scroller_section_title_indicator);
        fastScroller.setSectionIndicator(scrollIndicator);
    }
    // Show progress dialog
    if (progressDialog != null) {
        progressDialog.dismiss();
    }
    progressDialog = new ProgressDialog(getActivity());
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setCancelable(true);
    progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            task.cancel(true);
        }
    });
    if (task != null && task.getStatus().equals(AsyncTask.Status.RUNNING)) {
        progressDialog.show();
        progressDialog.setMax(task.listSize);
    }
    return rootView;
}