文件整理
This commit is contained in:
@ -36,29 +36,30 @@ public class DialogUtils {
|
||||
isShowHijackDialog = true;
|
||||
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context,
|
||||
R.layout.common_alertdialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.alertdialog_title);
|
||||
title.setText("警告");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.alertdialog_content);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("警告");
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
content.setText("您当前网络环境异常,下载地址已被替换(网络劫持),请更换网络环境进行下载。");
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirem.setText("确定");
|
||||
confirem.setOnClickListener(new OnClickListener() {
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 跳转wifi管理界面
|
||||
@ -67,6 +68,7 @@ public class DialogUtils {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setOnDismissListener(new Dialog.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@ -87,28 +89,30 @@ public class DialogUtils {
|
||||
isShowDeleteDialog = true;
|
||||
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context,
|
||||
R.layout.search_history_delete_dialog, null);
|
||||
View view = View.inflate(context, R.layout.search_history_delete_dialog, null);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.delete_dialog_title);
|
||||
title.setText("卸载");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_message);
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.delete_dialog_message);
|
||||
content.setText("您已安装了官方原版,该版本与插件版本冲突,是否卸载官方原版?");
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_cancel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.delete_dialog_cancel);
|
||||
cancel.setText("忽略");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.delete_dialog_confirm);
|
||||
confirem.setText("卸载");
|
||||
confirem.setOnClickListener(new OnClickListener() {
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
@ -117,6 +121,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setOnDismissListener(new Dialog.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@ -131,24 +136,27 @@ public class DialogUtils {
|
||||
public static void showWarningDialog(Context context, String msg, final ConfiremListener listener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.alertdialog_title);
|
||||
title.setText("下载提示");
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("下载提示");
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
content.setText(msg);
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirem.setText("继续");
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -159,6 +167,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -171,19 +180,24 @@ public class DialogUtils {
|
||||
public static void showSuccessDialog(Context context) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.gamedetails_attention_dialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.dialog_title);
|
||||
title.setText("关注成功");
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
message.setText("游戏的最新动态消息会优先提醒您,包括攻略、资讯、开服信息、开测信息以及最新的插件。");
|
||||
|
||||
view.findViewById(R.id.dialog_rl_cancel).setVisibility(View.GONE);
|
||||
|
||||
TextView confirm = (TextView) view.findViewById(R.id.dialog_confirm);
|
||||
confirm.setText("我知道了");
|
||||
confirm.setOnClickListener(new OnClickListener() {
|
||||
confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
message.setText("游戏的最新动态消息会优先提醒您,包括攻略、资讯、开服信息、开测信息以及最新的插件。");
|
||||
view.findViewById(R.id.dialog_rl_cancel).setVisibility(View.GONE);
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -192,21 +206,24 @@ public class DialogUtils {
|
||||
public static void showCancelDialog(Context context, final ConfiremListener listener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.gamedetails_attention_dialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.dialog_title);
|
||||
title.setText("取消关注");
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
Spanned content = Html.fromHtml("取消关注游戏后,您将无法及时收到游戏的" +
|
||||
"<font color='#ff0000'>攻略</font>、" +
|
||||
"<font color='#ff0000'>资讯</font>等最新动态提醒,您确定取消吗?");
|
||||
message.setText(content);
|
||||
|
||||
TextView cancel = (TextView) view.findViewById(R.id.dialog_cancel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
|
||||
Spanned content = Html
|
||||
.fromHtml("取消关注游戏后,您将无法及时收到游戏的<font color='#ff0000'>攻略</font>、<font color='#ff0000'>资讯</font>等最新动态提醒,您确定取消吗?");
|
||||
message.setText(content);
|
||||
|
||||
view.findViewById(R.id.dialog_rl_confirm).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.dialog_confirm).setOnClickListener(
|
||||
@ -219,6 +236,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -228,26 +246,26 @@ public class DialogUtils {
|
||||
final DismissListener dListener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("插件化安装");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.alertdialog_content);
|
||||
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
Spanned spanned = Html.fromHtml("您将进行插件化安装以实现插件功能,此过程将"
|
||||
+ "<font color=\"#ff0000\">卸载</font>" + "当前使用的版本并"
|
||||
+ "<font color=\"#ff0000\">安装插件版本</font>" + "。");
|
||||
content.setText(spanned);
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirm = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
TextView confirm = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirm.setText("确定");
|
||||
confirm.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -276,20 +294,22 @@ public class DialogUtils {
|
||||
public static void showDisclaimerDialog(Context context, String content) {
|
||||
final Dialog disclaimerDialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.setting_disclaimer_dialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.disclaimer_dialog_title);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.disclaimer_dialog_title);
|
||||
title.setText("免责声明");
|
||||
TextView message = (TextView) view
|
||||
.findViewById(R.id.disclaimer_dialog_message);
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.disclaimer_dialog_message);
|
||||
Spanned spanned = Html.fromHtml(content);
|
||||
message.setText(spanned);
|
||||
|
||||
view.findViewById(R.id.disclaimer_dialog_confirm).setOnClickListener(
|
||||
new OnClickListener() {
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
disclaimerDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
disclaimerDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
disclaimerDialog.setContentView(view);
|
||||
disclaimerDialog.show();
|
||||
|
||||
Reference in New Issue
Block a user