Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Migrated CollectionTask.Flag to Coroutines

Open thedroiddiv opened this issue 3 years ago • 0 comments

  • Post update flag behaviour has been taken up from FlagCardHandler which is just a subclass, without any additional implementations, of SuspendCardHandler.

  • CollectionTask.Flag extends DismissNotes class which provides just a wrapper which allows Flag.actualTask to executeInTransaction. Same functionality has been combined and implemented in function updateSelectedCardsFlag.

IDK why the class is named DismissNotes, really not describes what it does.

Previous implementation of Flag was really messy and very hard to follow unless you've gone line by line code (took me enough time to understand). Currently it is single commit, and I couldn't figure out to break this commit into smaller ones. Will try though, if reviewing becomes harder. I guess this migration makes it really easy to follow up what happens and where.

Fixes

Fixes a part of #7108

How Has This Been Tested?

Unit tests and Pixel 4a API 32

Checklist

  • [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
  • [ ] 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

thedroiddiv avatar Sep 20 '22 20:09 thedroiddiv