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

Scroll save cards

Open CyberButton opened this issue 2 years ago • 5 comments

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

CyberButton avatar Apr 02 '24 19:04 CyberButton

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

CyberButton avatar Apr 02 '24 19:04 CyberButton

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

github-actions[bot] avatar Apr 23 '24 15:04 github-actions[bot]

Final exams started 😭😭 sorry cant work on it for now

CyberButton avatar Apr 23 '24 15:04 CyberButton

Exams take prioirty, best of luck!

david-allison avatar Apr 23 '24 15:04 david-allison

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

github-actions[bot] avatar May 10 '24 21:05 github-actions[bot]