Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Asynchronous validation #12

Closed
thedumbtechguy opened this issue Jun 2, 2015 · 6 comments
Closed

Add Asynchronous validation #12

thedumbtechguy opened this issue Jun 2, 2015 · 6 comments

Comments

@thedumbtechguy
Copy link

I'd like to be able to validate some data server side, e.g. Username and email uniqueness.

I am working on this currently. I was thinking a callback will be passed along with the input. Rather than just returning a boolean, we can add an error message. That way we fallback on the default message if non is provided. This has the benefit allowing the user to have more control over the error message.

While validating, we can show a loading spinner.
Any thoughts? I'll work on this and send a pull.

@heinrichreimer
Copy link
Owner

Great idea! Looking forward to See your pull request

@thedumbtechguy
Copy link
Author

I am done with the change, but quick one. Do you think we should implement some sort of loading indicator or leave that to the user?

@heinrichreimer
Copy link
Owner

Yeah, a loading indicator with a customizable description below wpould be nice!

@thedumbtechguy
Copy link
Author

I am currently using this in my app. What I found is that it is best to leave the indicator to the user.

  1. This prevents bundling an extra dependency to have a consistent look across devices and leaves that decision to the user.
  2. We leave the lifecycle of the indicator (which is best as a dialog as there is no api to disable the input or add views) to the user.

@heinrichreimer
Copy link
Owner

Or we just use ProgressBar with an App compat theme, cause we're using the App Compat dependency anyway.

@heinrichreimer
Copy link
Owner

In the next release this will be resolved by overriding onCreateFinishedView() in the Activity and removing finish() from SingleInputFormActivity:

@Override
protected View onCreateFinishedView(LayoutInflater inflater, ViewGroup parent) {
    return inflater.inflate(R.layout.finished_layout, parent, false);
}

The default implementation returns null and no overlay is shown.
It's up to app developers to design their finished screen and they are free to use progressbars whithin it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants