Skip to content

Commit

Permalink
fix: 方法重复
Browse files Browse the repository at this point in the history
  • Loading branch information
ankio committed Jun 13, 2022
1 parent 1718417 commit 2493624
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions app/src/main/java/cn/dreamn/qianji_auto/ui/utils/BottomArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,46 +172,6 @@ public void onShow(DialogInterface dialogInterface) {
});
}

@SuppressLint("SetTextI18n")
static public void inputWithCheckBox(Context context, String title, String msg, String rightName, String leftName, String checkBoxText, boolean checked, InputWithCheckBoxCallback inputCallback) {
LayoutInflater factory = LayoutInflater.from(context);
final View textEntryView = factory.inflate(R.layout.include_list_input, null);
BottomSheet bottomSheet = new BottomSheet(LayoutMode.WRAP_CONTENT);
MaterialDialog dialog = new MaterialDialog(context, bottomSheet);
dialog.title(null, title);

TextInputEditText md_input_message = textEntryView.findViewById(R.id.md_input_message);
md_input_message.setText(msg);

MaterialCheckBox checkbox = textEntryView.findViewById(R.id.md_checkbox_prompt);
checkbox.setVisibility(View.VISIBLE);
checkbox.setText(checkBoxText);
checkbox.setChecked(checked);

Button button_next = textEntryView.findViewById(R.id.button_next);
Button button_last = textEntryView.findViewById(R.id.button_last);
button_next.setText(rightName);
button_last.setText(leftName);
button_next.setOnClickListener(v2 -> {
inputCallback.inputWithCheck(md_input_message.getText().toString(), checkbox.isChecked());
dialog.dismiss();
});

button_last.setOnClickListener(v2 -> {
inputCallback.cancel();
dialog.dismiss();
});

DialogCustomViewExtKt.customView(dialog, null, textEntryView,
false, true, false, false);
dialog.cornerRadius(15f, null);
dialog.show();
}
public interface InputWithCheckBoxCallback {
void inputWithCheck(String data, boolean checked);

void cancel();
}
static public void input(Context context, String title, String msg, String rightName, String leftName, InputCallback inputCallback) {
LayoutInflater factory = LayoutInflater.from(context);
final View textEntryView = factory.inflate(R.layout.include_list_input, null);
Expand Down

0 comments on commit 2493624

Please sign in to comment.