Scroll save cards
Purpose / Description
Persist Selected Cards Scroll state after switching to dark mode
Fixes
- Fixes https://github.com/ankidroid/Anki-Android/issues/15441
Approach
Save selected cards position and scroll offset, restore it only if necessary, specifically if user switched to dark mode outisde of cardBrowser
How Has This Been Tested?
Manually
Checklist
- [ x ] You have a descriptive commit message with a short title (first line, max 50 chars).
- [ ] 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
Example
https://github.com/ankidroid/Anki-Android/assets/67738637/dc5f7a68-1f5b-43f9-a59f-f2e5d65fe317
After reviewing the problem, I realized there may have been a misunderstanding on my part regarding the core issue. My interpretation was centered around a specific use-case: when a card is selected for editing and the editor is switched to dark mode, returning to the previous screen resulted in a loss of scroll position. So, I made changes to preserve the scroll state under these conditions.
Main problem is that in onScroll() if (size > 0 && visibleItemCount <= 0) was being executed right ? Or is it something different ?
Oh okay its also failing tests
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically
Final exams started 😭😭 sorry cant work on it for now
Exams take prioirty, best of luck!
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically