Ejemplo n.º 1
0
  public MyProgressDialogUtils(String message, Context mContext) {
    super();
    this.mContext = mContext;

    mProgressDialog = new MyProgressDialog(mContext, R.style.MyProgressDialog);

    mProgressDialog.setMessage(message);
    mProgressDialog.setCancelable(false);

    mProgressDialog.setOnCancelListener(this);
  }
Ejemplo n.º 2
0
  // 设置用户是否可以取消对话框
  public void setProgressDialogCancelable() {
    mProgressDialog.setCancelable(true);
    mProgressDialog.setOnCancelListener(
        new OnCancelListener() {

          @Override
          public void onCancel(DialogInterface arg0) {

            if (mProgressDialogCanceledListener != null) {
              mProgressDialogCanceledListener.canceled();
            }
          }
        });
  }
Ejemplo n.º 3
0
  public MyProgressDialogUtils(int message, Context mContext) {
    super();
    this.message = message;
    this.mContext = mContext;

    // <modify by Yongfeng.zhang 2014.11.12
    // mProgressDialog=new ProgressDialog(mContext);
    mProgressDialog = new MyProgressDialog(mContext, R.style.MyProgressDialog);
    // >end by Yongfeng.zhang 2014.11.12

    mProgressDialog.setMessage(mContext.getString(message));
    mProgressDialog.setCancelable(false);
    // mProgressDialog.setCanceledOnTouchOutside(true);

    mProgressDialog.setOnCancelListener(this);
  }
Ejemplo n.º 4
0
  // 使对话框消失
  public void dismissDialog() {

    if (mProgressDialog != null) {
      mProgressDialog.dismiss();
    }
  }
Ejemplo n.º 5
0
 // 显示对话框
 public void showDialog() {
   mProgressDialog.show();
 }