本文整理了Java中android.app.ProgressDialog.getButton()
方法的一些代码示例,展示了ProgressDialog.getButton()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressDialog.getButton()
方法的具体详情如下:
包路径:android.app.ProgressDialog
类名称:ProgressDialog
方法名:getButton
暂无
代码示例来源:origin: stackoverflow.com
ProgressDialog dlg = new ProgressDialog(this);
dlg.setButton(ProgressDialog.BUTTON_NEUTRAL,
"Close",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//button click stuff here
}
});
dlg.show();
dlg.getButton(ProgressDialog.BUTTON_NEUTRAL).setEnabled(false);
//or alternatively
//dlg.getButton(ProgressDialog.BUTTON_NEUTRAL).setVisibility(View.INVISIBLE);
代码示例来源:origin: evernote/evernote-sdk-android
@Override
public void run() {
Button button = mProgressDialog.getButton(DialogInterface.BUTTON_POSITIVE);
if (!TextUtils.isEmpty(bootstrapScreenName)) {
button.setText(getString(R.string.esdk_switch_to, bootstrapScreenName));
button.setVisibility(View.VISIBLE);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switchBootstrapProfile();
}
});
} else {
button.setVisibility(View.GONE);
button.setOnClickListener(null);
}
}
});
代码示例来源:origin: evernote/evernote-sdk-android
@Override
public void run() {
ProgressDialog dialog = (ProgressDialog) getDialog();
Button button = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
if (!TextUtils.isEmpty(bootstrapScreenName)) {
button.setText(getString(R.string.esdk_switch_to, bootstrapScreenName));
button.setVisibility(View.VISIBLE);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switchBootstrapProfile();
}
});
} else {
button.setVisibility(View.GONE);
button.setOnClickListener(null);
}
}
});
代码示例来源:origin: stackoverflow.com
ProgressDialog dialog = new ProgressDialog(this);
dialog.setButton(AlertDialog.BUTTON_POSITIVE, "confirm",
(DialogInterface.OnClickListener) null);
dialog.setButton(AlertDialog.BUTTON_NEGATIVE, "cancel",
(DialogInterface.OnClickListener) null);
dialog.show();
Button btConfirm = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) btConfirm
.getLayoutParams();
params.weight = 3;
代码示例来源:origin: stackoverflow.com
ProgressDialog loadingDialog = ProgressDialog.show(activity.this, "", "Loading...",
true, false);
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2500);
runOnUiThread(new Runnable() {
public void run() {
loadingDialog.dismiss();
loadingDialog.setButton(ProgressDialog.BUTTON_NEUTRAL,
"Close",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//button click stuff here
}
});
loadingDialog.show();
loadingDialog.getButton(ProgressDialog.BUTTON_NEUTRAL).setVisibility(View.INVISIBLE);
}
}
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
代码示例来源:origin: sunfusheng/FirUpdater
public void showDownloadDialog(Context context, int progress) {
if (progressDialog == null) {
progressDialog = new ProgressDialog(context);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setMax(100);
progressDialog.setTitle("正在下载");
progressDialog.setButton(DialogInterface.BUTTON_POSITIVE, "后台下载", (dialog, which) -> {
if (onClickDownloadDialogListener != null) {
onClickDownloadDialogListener.onClickBackgroundDownload(dialog);
}
});
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", (dialog, which) -> {
if (onClickDownloadDialogListener != null) {
onClickDownloadDialogListener.onClickCancelDownload(dialog);
}
});
progressDialog.show();
progressDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#333333"));
progressDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.parseColor("#9a9a9a"));
}
if (progressDialog.isShowing()) {
progressDialog.setProgress(progress);
}
}
代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android
mBufferingDialog.setCancelable(false);
mBufferingDialog.show();
mBufferingDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setEnabled(false);
(new Thread(){
public void run(){
内容来源于网络,如有侵权,请联系作者删除!