Skip to content

Instantly share code, notes, and snippets.

@ar-android
Last active November 12, 2017 06:13
Show Gist options
  • Save ar-android/2530e873385388a89a6e9ad6ddcaa078 to your computer and use it in GitHub Desktop.
Save ar-android/2530e873385388a89a6e9ad6ddcaa078 to your computer and use it in GitHub Desktop.

#Test

aq.id(R.id.login).click(v -> {
    if (aq.id(R.id.input_email).isValid() && aq.id(R.id.input_password).isValid()){
        Map<String, String> params = new HashMap<>();
        params.put("email", aq.id(R.id.input_email).text());
        params.put("password", aq.id(R.id.input_password).text());

        aq.ajax("https://ocit-tutorial.herokuapp.com/index.php")
                .post(params)
                .showLoading()
                .response((response, error) -> {
                    if (response != null){
                        aq.openFromRight(HomeActivity.class);
                    }
                });
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment