-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Don't allow empty name in flag #17856
base: main
Are you sure you want to change the base?
Conversation
440f0e0
to
e691ed8
Compare
@@ -92,6 +93,10 @@ class FlagAdapter( | |||
|
|||
holder.saveButton.setOnClickListener { | |||
val updatedTextName = holder.flagNameEdit.text.toString() | |||
if (updatedTextName.isEmpty()) { | |||
showThemedToast(holder.itemView.context, R.string.empty_flag_message, true) |
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.
No toasts please, the ideal approach would be to utilise the TextInputLayout
and show error text or do it the Anki way i.e. if user tries to save empty flag name then set it back to the default name which was used last
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.
Thanks!
Purpose / Description
Fixes the issue where a flag could be renamed to an empty value in the Card Browser. Now, empty flag names are not allowed.
Fixes
Approach
If user tries to save empty flag name then set it back to the default name which was used.
How Has This Been Tested?
Physical device (OPPO F21 Pro 5G)
flag.mp4
Checklist
Please, go through these checks before submitting the PR.