private void createValidationForm() {
    Validate emailField = new Validate(editTextEmail);
    Validate passwordField = new Validate(editTextPassword);

    emailField.addValidator(new NotEmptyValidator(LoginActivity.this));
    emailField.addValidator(new EmailValidator(LoginActivity.this));
    passwordField.addValidator(new NotEmptyValidator(LoginActivity.this));

    validationForm = new Form();
    validationForm.addValidates(emailField);
    validationForm.addValidates(passwordField);
  }
  /**
   * Attempts to sign in or register the account specified by the login validationForm. If there are
   * validationForm errors (invalid email, missing fields, etc.), the errors are presented and no
   * actual login attempt is made.
   */
  public void attemptLogin() {

    editTextEmail.setError(null);
    editTextPassword.setError(null);

    if (validationForm.validate()) {
      String email = editTextEmail.getText().toString();
      String password = editTextPassword.getText().toString();

      textViewMessageView.setText(R.string.login_progress_signing_in);
      hideKeyboard();

      showProgress(true);

      new RequestTokenAsyncTask(executor).execute(email, password);
    } else {
      showProgress(false);
    }
  }