本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}