本文整理匯總了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;
}