Improved Review forgotten cards dialog#21379
Conversation
|
Important Maintainers: This PR contains Strings changes
|
sanjaysargam
left a comment
There was a problem hiding this comment.
When there is no input or 0, then the suffix is showing days
Is this intentional ?
| filters += NonLeadingZeroInputFilter | ||
|
|
||
| setText(defaultValue) | ||
|
|
| R.plurals.set_due_date_label_suffix, | ||
| defaultValue.toIntOrNull() ?: 0, | ||
| ) | ||
| doOnTextChanged { text, _, _, _ -> |
There was a problem hiding this comment.
This might be slightly inefficient
consider doAfterTextChanged which fires once per text change
|
I see test is failing |
The former is intentional by design as I reused one of the strings from 03-dialogs.xml which changes from days to day when there's 1 but days for the rest (as seen in the parent issue here). |
Actually I was wondering about this with how the translations would work when changing the string in line 38 of the xml file: After doing some reading of the Development Guide, do I need to make a separate pull request for this change to appear? |
Purpose / Description
This improves on the Review forgotten cards dialog option in Custom study. It solves most of the tasks listed in the issue below but leaves room for reusable code as I wait on #20678. I'm opening up this pull request to show progress and welcome any feedback for changes and if I can move on with wrapping up the last task, then I will proceed and update here.
Fixes
Approach
It reuses code from SetDueDateDialog.kt and implements the added file from #20520, NonLeadingZeroInputFilter.kt which prevents additional 0s to be added.
Attached below is a screen recording of the emulator showing these changes:
Review.forgotten.cards.mp4
How Has This Been Tested?
Emulated on a Pixel 9, API 36.0
Learning (optional, can help others)
Describe the research stage
What helped me write parts of the solution for this option in custom study dialog that could be helpful for the other options is referencing SetDueDateDialog.kt
Checklist
Please, go through these checks before submitting the PR.