Anki-Android
Anki-Android copied to clipboard
feat(new reviewer): answer timer
localized below the Count numbers to avoid losing screen space
Approach
- Add an improved subclass of
Chronometerto handle configuration changes properly - Add the Timer below the Count numbers
- Setup the timer
How Has This Been Tested?
Emulator SDK 35:
https://github.com/user-attachments/assets/9a2a7f1c-00cc-4fe3-bafd-85ce80480e19
Android 15 phone (Galaxy S23):
https://github.com/user-attachments/assets/5aae8232-eec6-47fd-ad79-1980f6f119f2
Learning (optional, can help others)
- Had heard before about ConstraintLayout Flow, but never used it until now
- You can force the emission of the same value in MutableStateFlow by overriding equals() and hashCode() https://stackoverflow.com/questions/62331931/mutablestateflow-is-not-emitting-values-after-1st-emit-kotlin-coroutine
Checklist
Please, go through these checks before submitting the PR.
- [X] You have a descriptive commit message with a short title (first line, max 50 chars).
- [X] You have commented your code, particularly in hard-to-understand areas
- [X] You have performed a self-review of your own code
- [X] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
In the first video, the answer counts are not in a stable position on the screen. Can this be fixed?
the timer can be in the top left of the screen.
https://github.com/user-attachments/assets/633eb240-b5e8-4f08-8d1f-1c0ff4595e08
Both options are fine to me. I just don't want to lose vertical space.
With the toolbar on the bottom
I prefer the timer below the counts. Very minor preference. Implementer's choice
My point was that It's distracting to have UI elements move in-between cards.
My point was that It's distracting to have UI elements move in-between cards.
In most use cases, the user either will never use the timer or always use the timer. If they have mixed deck options, and with the same parent deck, the vanishing/appearing timer calls the atention either way, and that may be even beneficial for that case, so the user notices that there is a timer.
@BrayanDSO - I think you mean "In most use cases, the user either will never use the timer or always use the timer" (never/always, vs never/never) ?
@david-allison I'm inclined to agree, I don't think most decks contain mixed note types, and I don't think most people that like the timer will only use it sometimes, and my guess at the intersection of those two guesses is pretty small and Brayan's argument it might even be a positive is somewhat persuasive. I'm inclined to go with Brayan on this one and go with it as-is
Needs consensus either way though ?
In most use cases, the user either will never use the timer or always use the timer" (never/always, vs never/never) ?
Never/Always.