car/app/app-samples/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/templates/SignInTemplateDemoScreen.java
/**
     * Moves to the password screen if the user name currently entered is valid, or displays
     * an error message otherwise.
     */
Moves to the password screen if the user name currently entered is valid, or displays
an error message otherwise.
Moves to the password screen if the user name currently entered is valid or displays an error message otherwise .
void submitUsername() {
        mErrorMessage = validateUsername();
        boolean isError = !mErrorMessage.isEmpty();
        if (!isError) {
            mState = State.PASSWORD;
        }
        invalidate();
    }
void submitUsername ( ) { mErrorMessage = validateUsername ( ) ; boolean isError = ! mErrorMessage . isEmpty ( ) ; if ( ! isError ) { mState = State . PASSWORD ; } invalidate ( ) ; }
Moves to the password screen if the user name currently entered is valid, or displays
 an error message otherwise.
Moves to the password screen if the user name currently entered is valid or displays an error message otherwise .
// If there's no error, go to the password screen. // Invalidate the template so that we either display an error, or go to the password screen.