car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java
/**
     * Validates the currently entered user name and returns an error message string if invalid,
     * or an empty string otherwise.
     */
Validates the currently entered user name and returns an error message string if invalid,
or an empty string otherwise.
Validates the currently entered user name and returns an error message string if invalid or an empty string otherwise .
String validateUsername() {
        if (mUsername == null || mUsername.length() < MIN_USERNAME_LENGTH) {
            return getCarContext().getString(R.string.invalid_length_error_msg,
                    Integer.toString(MIN_USERNAME_LENGTH));
        } else if (!mUsername.matches(EMAIL_REGEXP)) {
            return getCarContext().getString(R.string.invalid_email_error_msg);
        } else {
            return "";
        }
    }
String validateUsername ( ) { if ( mUsername == null || mUsername . length ( ) < MIN_USERNAME_LENGTH ) { return getCarContext ( ) . getString ( R . string . invalid_length_error_msg , Integer . toString ( MIN_USERNAME_LENGTH ) ) ; } else if ( ! mUsername . matches ( EMAIL_REGEXP ) ) { return getCarContext ( ) . getString ( R . string . invalid_email_error_msg ) ; } else { return "" ; } }
Validates the currently entered user name and returns an error message string if invalid,
 or an empty string otherwise.
Validates the currently entered user name and returns an error message string if invalid or an empty string otherwise .