Source:
<code>RenameDialog(Context context, final Listener listener) { renameAmountDialog = new MaterialDialog.Builder(context) .inputType(InputType.TYPE_CLASS_NUMBER) .input(context.getString(R.string.num_copies), "", (dialog, input) -> { if (input.length() > 0) { int amount = Integer.parseInt(input.toString()); boolean validNumber = amount > 0 && amount <= currentMaxAmount; dialog.getActionButton(DialogAction.POSITIVE).setEnabled(validNumber); return; } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .positiveText(R.string.next) .onNeutral((dialog, which) -> { <START> dialog.getInputEditText().setText("" + currentMaxAmount); <END> handlePositiveAmountToRename(); }) .onPositive((dialog, which) -> { handlePositiveAmountToRename(); }) .build(); renamingDialog = new MaterialDialog.Builder(context) .title(R.string.change_name) .input(context.getString(R.string.new_name), currentName, (dialog, input) -> { boolean submitEnabled = !(input.toString().trim().isEmpty() || input.toString().equals(currentName)); dialog.getActionButton(DialogAction.POSITIVE).setEnabled(submitEnabled); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .onAny((dialog, which) -> { if (which == DialogAction.POSITIVE) { String newName = dialog.getInputEditText().getText().toString().trim(); listener.onRenameSubmitted(currentName, newName, amountToRename); } else if (which == DialogAction.NEUTRAL) { renameAmountDialog.show(); } }) .build(); }</code><technical_language>This feels kind of hacky, I slower converting normally. suggestion dialog.getInputEditText().setText(String.valueOf(currentMaxAmount));</technical_language>

Target:
public RenameDialog(Context context, final Listener listener) { renameAmountDialog = new MaterialDialog.Builder(context) .content(R.string.multiple_renames_title) .inputType(InputType.TYPE_CLASS_NUMBER) .input(context.getString(R.string.num_copies), "", (dialog, input) -> { if (input.length() > 0) { int amount = Integer.parseInt(input.toString()); boolean validNumber = amount > 0 && amount <= currentMaxAmount; dialog.getActionButton(DialogAction.POSITIVE).setEnabled(validNumber); return; } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .positiveText(R.string.next) .onPositive((dialog, which) -> { amountToRename = Integer.parseInt( dialog.getInputEditText().getText().toString().trim()); goIntoRenamingDialogFromAmountChoice(); }) .build(); renamingDialog = new MaterialDialog.Builder(context) .title(R.string.change_name) .input(context.getString(R.string.new_name), currentName, (dialog, input) -> { boolean submitEnabled = !(input.toString().trim().isEmpty() || input.toString().equals(currentName)); dialog.getActionButton(DialogAction.POSITIVE).setEnabled(submitEnabled); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .onAny((dialog, which) -> { if (which == DialogAction.POSITIVE) { String newName = dialog.getInputEditText().getText().toString().trim(); listener.onRenameSubmitted(currentName, newName, amountToRename); } else if (which == DialogAction.NEUTRAL) { renameAmountDialog.show(); } }) .build(); }