Source:
<code>protected void showDialog(Bundle state) { super.showDialog(state); final AlertDialog dialog = (AlertDialog) getDialog(); final Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); if (positiveButton != null) { positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { callChangeListener(getEditText().getText()); dialog.dismiss(); } }); positiveButton.setTextColor(ContextCompat.getColorStateList(getContext(), R.color.primary_400_neutral_400_selector)); getEditText().addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { switch (mValidationType) { case NONE: break; case EMAIL: positiveButton.setEnabled(ValidationUtils.validateEmail(s)); break; case PASSWORD: positiveButton.setEnabled(ValidationUtils.validatePassword(s)); break; case URL: positiveButton.setEnabled(ValidationUtils.validateUrl(s)); break; case NOT_EMPTY: <START> positiveButton.setEnabled(!s.toString().isEmpty()); <END> } } }); } CharSequence summary = getSummary(); if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) { getEditText().setText(""); } else { getEditText().setText(summary); getEditText().setSelection(0, summary.length()); } hideInputCharacters(mValidationType == ValidationType.PASSWORD); }</code><technical_language>suggestion positiveButton.setEnabled(ValidationUtils.validatePasswordSelfHosted(s)); checking if string is empty, add validation in ValidationUtils specific self-hosted passwords function. kotlin fun validatePasswordSelfHosted(text: CharSequence): Boolean = validate(PASSWORD_SELF_HOSTED_PATTERN, text) PASSWORD_SELF_HOSTED_PATTERN in function if require single character for self-hosted password. kotlin private val PASSWORD_SELF_HOSTED_PATTERN = Pattern.compile("^(.)+$")</technical_language>

Target:
protected void showDialog(Bundle state) { super.showDialog(state); final AlertDialog dialog = (AlertDialog) getDialog(); final Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); if (positiveButton != null) { positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { callChangeListener(getEditText().getText()); dialog.dismiss(); } }); positiveButton.setTextColor(ContextCompat.getColorStateList(getContext(), R.color.primary_400_neutral_400_selector)); getEditText().addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { switch (mValidationType) { case NONE: break; case EMAIL: positiveButton.setEnabled(ValidationUtils.validateEmail(s)); break; case PASSWORD: positiveButton.setEnabled(ValidationUtils.validatePassword(s)); break; case URL: positiveButton.setEnabled(ValidationUtils.validateUrl(s)); break; case PASSWORD_SELF_HOSTED: positiveButton.setEnabled(ValidationUtils.validatePasswordSelfHosted(s)); } } }); } CharSequence summary = getSummary(); if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) { getEditText().setText(""); } else { getEditText().setText(summary); getEditText().setSelection(0, summary.length()); } hideInputCharacters( mValidationType == ValidationType.PASSWORD || mValidationType == ValidationType.PASSWORD_SELF_HOSTED); }