-
Notifications
You must be signed in to change notification settings - Fork 554
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
Droneshare login field validation and keyboard release #1422
Conversation
…count creation - it'd occasionally persist after login screen was dismissed.
… message are added to fields missing values, login can only proceed once all fields have been entered.
…characters, with 1 digit. Login allows abritary passwords, since existing accounts might not meet this requirement.
} | ||
} | ||
|
||
public abstract class TextValidator implements TextWatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TextValidator
should be declared as a static inner class since it doesn't use any references from the parent class.
@peterhinson your PR looks great! |
@peterhinson These are usually placed in the |
Droneshare login field validation and keyboard release
Good to know. Thanks! |
Adds basic validation to username, password, and email when registering/logging into Droneshare.
The validation is pretty simple: usernames must be >1 characters. Emails must be .. well, emails. Login/signup is prevented unless the fields validate, and an error icon with an informative message is appended to the invalid field.
Passwords are little more tricky- Droneshare requires at least 7 characters and 1 digit. This hasn't been enforced via account creation using their API however, so DroidPlanner users have been able to create arbitrary passwords. I've added the character and digit restrictions to signup, but allow logging in users to use passwords of any length.
While it's nice to have instant feedback on what you're doing wrong within the app, this creates independent validation rules on the client and server. In the long run, it seems like the server should be responsible for validation.
I also added a method to hide the keyboard after login/signup. If the user hadn't hidden it at time of login, it would stay on screen after loading the Droneshare dashboard.
This is my first contribution to DroidPlanner/Tower (hoorah), figured something harmless would be a good start. Please let me know if I'm stepping on any of your contrib guidelines! :)