当前位置: 首页>>代码示例>>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;未经允许,请勿转载。