testing-samples icon indicating copy to clipboard operation
testing-samples copied to clipboard

Why does BasicSample validate email field on every character change and not just when the Save button is pressed?

Open github-second opened this issue 7 years ago • 0 comments

android-testing/unit/BasicSample adds a listener like this: mEmailText.addTextChangedListener(mEmailValidator); And then on save it checks

if (!mEmailValidator.isValid()) {  
            mEmailText.setError("Invalid email");}

Why not just have a simple utility class which will perform this check only when the save button is pressed? Just asking for a clarification.

github-second avatar Nov 05 '18 15:11 github-second