android.app.ProgressDialog.setProgressStyle()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中android.app.ProgressDialog.setProgressStyle()方法的一些代码示例,展示了ProgressDialog.setProgressStyle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressDialog.setProgressStyle()方法的具体详情如下:
包路径:android.app.ProgressDialog
类名称:ProgressDialog
方法名:setProgressStyle

ProgressDialog.setProgressStyle介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.setCancelable(false);
  mProgressDialog.show();
switch (resultCode) {
  case Groundy.STATUS_PROGRESS:
    mProgressDialog.setProgress(resultData.getInt(Groundy.KEY_PROGRESS));
    break;
  case Groundy.STATUS_FINISHED:
    Toast.makeText(DownloadExample.this, R.string.file_downloaded, Toast.LENGTH_LONG);
    mProgressDialog.dismiss();
    break;
  case Groundy.STATUS_ERROR:
    Toast.makeText(DownloadExample.this, resultData.getString(Groundy.KEY_ERROR), Toast.LENGTH_LONG).show();
    mProgressDialog.dismiss();
    break;

代码示例来源:origin: stackoverflow.com

// create a ProgressDialog instance, with a specified theme:    
ProgressDialog dialog = new ProgressDialog(mContext, ProgressDialog.THEME_HOLO_DARK);
// set indeterminate style
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
// set title and message
dialog.setTitle("Please wait");
dialog.setMessage("Loading dictionary file...");
// and show it
dialog.show();

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
 ProgressDialog dlg=new ProgressDialog(getActivity());
 dlg.setMessage(getActivity().getString(R.string.dlg_title));
 dlg.setIndeterminate(true);
 dlg.setProgressStyle(ProgressDialog.STYLE_SPINNER);
 return(dlg);
}

代码示例来源:origin: andDevW/getChromium

private void showProgress() {
  mProgressDialog = new ProgressDialog(this);
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.setTitle(getString(R.string.progress_title));
  mProgressDialog.setMessage(getString(R.string.progress_detail));
  mProgressDialog.setIndeterminate(true);
  mProgressDialog.setCancelable(false);
  mProgressDialog.setProgress(0);
  mProgressDialog.setProgressNumberFormat(null);
  mProgressDialog.setProgressPercentFormat(null);
  mProgressDialog.show();
}

代码示例来源:origin: DaxiaK/MyDiary

private void initProgressDialog() {
  progressDialog = new ProgressDialog(getActivity());
  progressDialog.setMessage(getString(R.string.process_dialog_loading));
  progressDialog.setCancelable(false);
  progressDialog.setProgressStyle(android.R.style.Widget_ProgressBar);
}

代码示例来源:origin: stackoverflow.com

public class Main extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  final ProgressDialog _progressDialog = new ProgressDialog(this);
  _progressDialog.setIcon(R.drawable.icon);
  _progressDialog.setTitle("Loading ...");
  _progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

  new AsyncTask<Void, Void, Void>() {
   protected Long doInBackground(Void ... urls) {
     GetData();
   }

   protected void onPostExecute(Void result) {
     _progressDialog.dismiss();
   }

   protected void onPreExecute(Void no) {
     _progressDialog.show();
   }

  }.execute();

}

代码示例来源:origin: ukanth/afwall

mPDialog.setCancelable(false);
mPDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

代码示例来源:origin: stackoverflow.com

public class Utility {
  public static ProgressDialog getProgressDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context,
        R.style.TransparentDialog);
    progressDialog.setCancelable(false);
    progressDialog
        .setProgressStyle(android.R.style.Widget_ProgressBar_Small);
    progressDialog.setProgress(0);
    return progressDialog;
  }

}

代码示例来源:origin: stackoverflow.com

public static final int DIALOG_DOWNLOAD_PROGRESS = 0;
private ProgressDialog mProgressDialog;

@Override
protected Dialog onCreateDialog(int id) {
  switch (id) {
  case DIALOG_DOWNLOAD_PROGRESS:
    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setMessage("waiting 5 minutes..");
    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    mProgressDialog.setCancelable(false);
    mProgressDialog.show();
    return mProgressDialog;
  default:
  return null;
  }
}

代码示例来源:origin: stackoverflow.com

ProgressDialog dialog = new ProgressDialog(this); // this = YourActivity
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading. Please wait...");
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();

代码示例来源:origin: DaxiaK/MyDiary

private void initProgressDialog() {
  progressDialog = new ProgressDialog(getActivity());
  progressDialog.setMessage(getString(R.string.process_dialog_loading));
  progressDialog.setCancelable(false);
  progressDialog.setProgressStyle(android.R.style.Widget_ProgressBar);
}

代码示例来源:origin: 8enet/AppOpsX

@Override
public void showProgress(boolean show, int max) {
 if (progressDialog != null && progressDialog.isShowing()) {
  progressDialog.dismiss();
  progressDialog = null;
 }
 if (show) {
  progressDialog = new ProgressDialog(getActivity());
  progressDialog.setTitle(R.string.dlg_title);
  progressDialog.setCanceledOnTouchOutside(false);
  progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  progressDialog.setMax(max);
  progressDialog.show();
 }
}

代码示例来源:origin: stackoverflow.com

import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class ProgressDialogFragment extends DialogFragment
{
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setCancelable(false);
  }

  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState)
  {
    ProgressDialog dialog = new ProgressDialog(getActivity(), getTheme());
    dialog.setTitle(getString(R.string.pleaseWait));
    dialog.setMessage(getString(R.string.webpage_being_loaded));
    dialog.setIndeterminate(true);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    return dialog;
  }
}

代码示例来源:origin: Stericson/RootTools

mPDialog.setCancelable(false);
mPDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

代码示例来源:origin: stackoverflow.com

public class Utility {

  public static ProgressDialog getProgressDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context,
        R.style.TransparentDialog);
    progressDialog.setCancelable(false);
    progressDialog
        .setProgressStyle(android.R.style.Widget_ProgressBar_Small);
    progressDialog.setProgress(0);
    return progressDialog;
  }

}

代码示例来源:origin: czy1121/update

@Override
public void onStart() {
  if (mContext instanceof Activity && !((Activity) mContext).isFinishing()) {
    ProgressDialog dialog = new ProgressDialog(mContext);
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setMessage("下载中...");
    dialog.setIndeterminate(false);
    dialog.setCancelable(false);
    dialog.show();
    mDialog = dialog;
  }
}

代码示例来源:origin: stackoverflow.com

ProgressDialog mProgressDialog = new ProgressDialog(Your_Activity.this);
mProgressDialog.setMessage("Here you can set a message");
mProgressDialog.setIndeterminate(false);
mProgressDialog.setMax(100);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.show();
MyAsyncTask obj = new MyAsyncTask ();
obj.execute("url");

代码示例来源:origin: jberkel/sms-backup-plus

@SuppressWarnings("deprecation")
  @Override @NonNull
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    // NB: progress dialog is not AppCompat-ready, and will not appear themed
    //     correctly on older devices
    android.app.ProgressDialog progress = new android.app.ProgressDialog(getContext());
    progress.setTitle(null);
    progress.setProgressStyle(android.app.ProgressDialog.STYLE_SPINNER);
    progress.setMessage(getString(R.string.ui_dialog_access_token_msg));
    progress.setIndeterminate(true);
    progress.setCancelable(false);
    return progress;
  }
}

代码示例来源:origin: robolectric/robolectric

@Test
 public void spinnerStyle_shouldGetMessage() {
  String message = "This is only a test";
  shadow.callOnCreate(null);

  dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  dialog.setMessage(message);

  assertThat(shadow.getMessage().toString()).contains(message);
 }
}

代码示例来源:origin: ukanth/afwall

mPDialog.setCancelable(false);
mPDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

相关文章