當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressDialog.getWindow方法代碼示例

本文整理匯總了Java中android.app.ProgressDialog.getWindow方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressDialog.getWindow方法的具體用法?Java ProgressDialog.getWindow怎麽用?Java ProgressDialog.getWindow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.ProgressDialog的用法示例。


在下文中一共展示了ProgressDialog.getWindow方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showLoadingDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:CommonUtils.java

示例2: showLoadingDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
/**
 * Show loading progress
 */
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.dialog_progress);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(true);
  progressDialog.setCanceledOnTouchOutside(false);

  return progressDialog;
}
 
開發者ID:nikacotAndroid,項目名稱:Weather-Guru-MVP,代碼行數:18,代碼來源:AppUtils.java

示例3: showLoadingDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
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;
}
 
開發者ID:iamBedant,項目名稱:InstantAppStarter,代碼行數:13,代碼來源:CommonUtils.java

示例4: showLoadingDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
/**
 * Show loading progress
 */
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.dialog_progress);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setCanceledOnTouchOutside(false);

    return progressDialog;
}
 
開發者ID:graviton57,項目名稱:TheNounProject,代碼行數:18,代碼來源:AppUtils.java

示例5: onCreateDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
  String type = getArguments().getString("type");

  progress = new ProgressDialog(getActivity());

  Window window = progress.getWindow();
  window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);

  switch (type) {
    case "meme_scan":
      progress.setMax(100);
      progress.setMessage(getString(R.string.meme_scanning));
      progress.setTitle(getString(R.string.meme_scan_connect_title));
      progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progress.setCancelable(false);
      /*
      progress.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel),
          new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              if (mListener != null) {
                mListener.doNegativeClick("meme_connect");
              }
            }
          });
          */
      break;
    case "meme_connect":
      progress.setMax(100);
      progress.setMessage(getString(R.string.meme_scanning));
      progress.setTitle(getString(R.string.meme_scan_connect_title));
      progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progress.setCancelable(false);
      progress.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel),
          new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              if (mListener != null) {
                mListener.doNegativeClick("meme_connect");
              }
            }
          });
      break;
    case "hue_search":
      progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progress.setMessage(getString(R.string.hue_searching));
      progress.setCancelable(false);
      break;
    case "hue_connect":
      progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progress.setMessage(getString(R.string.hue_push_link_button));
      progress.setCancelable(false);
      break;
    case "spotify_loading":
      progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progress.setMessage(getString(R.string.spotify_loading));
      progress.setCancelable(false);
      break;
  }

  return progress;
}
 
開發者ID:tkrworks,項目名稱:JinsMemeBRIDGE-Android,代碼行數:65,代碼來源:ProgressDialogFragment.java


注:本文中的android.app.ProgressDialog.getWindow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。