-
Notifications
You must be signed in to change notification settings - Fork 10
Allow users enter their card expiry date easily; provide better UX #19
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
Conversation
|
Looks good. Will test and merge soon. Thanks |
| public void afterTextChanged(Editable editable) { | ||
| String input = editable.toString(); | ||
| SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/yy"); | ||
| Calendar calendar = Calendar.getInstance(); |
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.
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.
Oh...true.
I will fix that. Thanks
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.
It's updated now.
| @Override | ||
| public void afterTextChanged(Editable editable) { | ||
| String input = editable.toString(); | ||
| SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/yy"); |
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.
You're creating an instance of simpleDateFormat each time the text changes which is expensive. Try to create it once in the ExpiryWatcher()'s constructor and use that instance in line 860 instead just like you did for your calendar variable. Neat work by the way
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.
Oh true. Correcting that...
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.
DONE.
Considering what most users have gotten used to, allowing them to enter their expiry date in text will provide a better user experience.