问题提交增加相似/重复处理
This commit is contained in:
@ -927,6 +927,53 @@ public class DialogUtils {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 特殊:目前只在提交问题错误返回时弹出
|
||||
*/
|
||||
public static Dialog showCommunityDialog(Context context,
|
||||
String title,
|
||||
String contentTitle,
|
||||
String contentDes,
|
||||
String negative,
|
||||
String positive,
|
||||
final CancelListener clListener,
|
||||
final ConfirmListener cmListener) {
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
|
||||
|
||||
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_community, null);
|
||||
TextView titleTv = contentView.findViewById(R.id.title);
|
||||
TextView contentTitleTv = contentView.findViewById(R.id.content_title);
|
||||
TextView contentDesTv = contentView.findViewById(R.id.content_des);
|
||||
TextView negativeTv = contentView.findViewById(R.id.negative);
|
||||
TextView positiveTv = contentView.findViewById(R.id.positive);
|
||||
titleTv.setText(title);
|
||||
negativeTv.setText(negative);
|
||||
positiveTv.setText(positive);
|
||||
contentTitleTv.setText(contentTitle);
|
||||
contentDesTv.setText(contentDes);
|
||||
|
||||
negativeTv.setOnClickListener(view -> {
|
||||
if (clListener != null) {
|
||||
clListener.onCancel();
|
||||
}
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
positiveTv.setOnClickListener(view -> {
|
||||
if (cmListener != null) {
|
||||
cmListener.onConfirm();
|
||||
}
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(contentView);
|
||||
dialog.show();
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public interface ConfirmListener {
|
||||
void onConfirm();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user