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

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

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

ProgressDialog.getWindow介绍

暂无

代码示例

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

public static ProgressDialog createProgressDialog(Context mContext) {
     ProgressDialog dialog = new ProgressDialog(mContext);
     try {
         dialog.show();
     } catch (BadTokenException e) {
     }
     dialog.setCancelable(false);
     dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
     dialog.setContentView(R.layout.progressdialog);
     // dialog.setMessage(Message);
     return dialog;
 }

代码示例来源:origin: jdamcd/android-crop

public void run() {
    activity.removeLifeCycleListener(BackgroundJob.this);
    if (dialog.getWindow() != null) dialog.dismiss();
  }
};

代码示例来源:origin: MindorksOpenSource/android-mvp-architecture

public static ProgressDialog showLoadingDialog(Context context) {
  ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.show();
  if (progressDialog.getWindow() != null) {
    progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  }
  progressDialog.setContentView(R.layout.progress_dialog);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.setCanceledOnTouchOutside(false);
  return progressDialog;
}

代码示例来源:origin: multidots/android-app-common-tasks

public void run() {
    mActivity.removeLifeCycleListener(BackgroundJob.this);
    if (mDialog.getWindow() != null) mDialog.dismiss();
  }
};

代码示例来源:origin: multidots/android-app-common-tasks

public void run() {
    mActivity.removeLifeCycleListener(BackgroundJob.this);
    if (mDialog.getWindow() != null) mDialog.dismiss();
  }
};

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

ProgressDialog pDialog = new ProgressDialog(MainActivity.this, R.style.AppTheme);
 pDialog.setCancelable(false);
 pDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Small);
 pDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
 pDialog.show();

代码示例来源:origin: yayaa/LocationManager

private void displayProgress() {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(this);
    progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE);
    progressDialog.setMessage("Getting location...");
  }
  if (!progressDialog.isShowing()) {
    progressDialog.show();
  }
}

代码示例来源:origin: liuguangqiang/IPicker

public void run() {
    activity.removeLifeCycleListener(BackgroundJob.this);
    if (dialog.getWindow() != null) dialog.dismiss();
  }
};

代码示例来源:origin: yayaa/LocationManager

private void displayProgress() {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(this);
    progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE);
    progressDialog.setMessage("Getting location...");
  }
  if (!progressDialog.isShowing()) {
    progressDialog.show();
  }
}

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

private void dismissProgress() {
  if (mProgressDialog != null && mProgressDialog.
      isShowing() && mProgressDialog.getWindow() != null) {
    try {
      mProgressDialog.dismiss();
    } catch ( IllegalArgumentException ignore ) {
    }
  }
  mProgressDialog = null;
}

代码示例来源:origin: Ronak-LM/memoir

@Override
  public void run() {
    removeLifeCycleListener(Job.this);
    if (mDialog.getWindow() != null) {
      mDialog.dismiss();
    }
  }
};

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

//In your asynctask

ProgressDialog progressDialog;

//In onPreExecute

progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Fetching images");
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(false);
progressDialog.getWindow().setGravity(Gravity.BOTTOM);
progressDialog.show();

//In onPostExecute
progressDialog.dismiss();

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

final ProgressDialog dialog = ProgressDialog.show(MainActivity.this, null, null);
   ProgressBar spinner = new android.widget.ProgressBar(MainActivity.this, null,android.R.attr.progressBarStyle);
   spinner.getIndeterminateDrawable().setColorFilter(Color.parseColor("#53CBF1"), android.graphics.PorterDuff.Mode.SRC_IN);
   dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
   dialog.setContentView(spinner);
   dialog.setCancelable(false);
   dialog.show();

代码示例来源:origin: osfans/trime

private void initProgressDialog() {
 mProgressDialog = new ProgressDialog(mContext);
 mProgressDialog.setMessage(mContext.getString(R.string.themes_progress));
 mProgressDialog.setCancelable(false);
 if (mToken != null) {
  Window window = mProgressDialog.getWindow();
  WindowManager.LayoutParams lp = window.getAttributes();
  lp.token = mToken;
  lp.type = Trime.getDialogType();
  window.setAttributes(lp);
  window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
 }
}

代码示例来源:origin: gpfduoduo/AirPlay-Receiver-on-Android

public void run() {
    mActivity.removeLifeCycleListener(BackgroundJob.this);
    if (mDialog.getWindow() != null)
      mDialog.dismiss();
  }
};

代码示例来源:origin: MindorksOpenSource/android-mvp-interactor-architecture

public static ProgressDialog showLoadingDialog(Context context) {
  ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.show();
  if (progressDialog.getWindow() != null) {
    progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  }
  progressDialog.setContentView(R.layout.progress_dialog);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.setCanceledOnTouchOutside(false);
  return progressDialog;
}

代码示例来源:origin: playerone-id/EosCommander

public static ProgressDialog showLoadingDialog(Context context) {
  ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.show();
  if (progressDialog.getWindow() != null) {
    progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  }
  progressDialog.setContentView(R.layout.progress_dialog);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.setCanceledOnTouchOutside(false);
  return progressDialog;
}

代码示例来源:origin: MindorksOpenSource/SnapHelperExample

public static ProgressDialog showLoadingDialog(Context context) {
  ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.show();
  if (progressDialog.getWindow() != null) {
    progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  }
  progressDialog.setContentView(R.layout.progress_dialog);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(true);
  progressDialog.setCanceledOnTouchOutside(false);
  return progressDialog;
}

代码示例来源:origin: yayaa/LocationManager

private void displayProgress() {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(getContext());
    progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE);
    progressDialog.setMessage("Getting location...");
  }
  if (!progressDialog.isShowing()) {
    progressDialog.show();
  }
}

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

final ProgressDialog pd = new ProgressDialog(MainActivity.this);
     // Set progress dialog style spinner
     pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
     // Set the progress dialog title and message
     pd.setTitle("Title of progress dialog.");
     pd.setMessage("Loading.........");
     // Set the progress dialog background color
     pd.getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FFD4D9D0")));
     pd.setIndeterminate(false);
     // Finally, show the progress dialog
     pd.show();

相关文章