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

Whiteboard data loss when theme switch[Bug]

Open imaryandokania opened this issue 5 years ago • 8 comments

Reproduction Steps
  1. The whiteboard draw option
  2. when pen is used
  3. And then night mode is switched, the whiteboard gets cleared
Actual Result

ezgif com-video-to-gif

Expected Result

Caching of the whiteboard data

Debug info

I am ready to work on this , probably can be done by saving data as svg before changing the theme.

Possible changes in restartActivityInvalidateBackstack function

Research

Enter an [x] character to confirm the points below:

  • [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
  • [x] I have checked the manual and the FAQ and could not find a solution to my issue
  • [x] I have searched for similar existing issues here and on the user forum
  • [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)

imaryandokania avatar Mar 14 '21 12:03 imaryandokania

This is a special case of #3654 - that issue has info on how to easily reproduce

mikehardy avatar Mar 14 '21 20:03 mikehardy

I am thinking for an alternative way, this will allow the restart of the app but with all datas intact , the coordinates of the drawing areeas can be added to sql lite

imaryandokania avatar Mar 15 '21 00:03 imaryandokania

@david-allison-1 what are your views on this?

imaryandokania avatar Mar 15 '21 00:03 imaryandokania

My understanding is that we don't lose memory when the theme is switched. The whiteboard is a small quantity of data which shouldn't be enough to require persistent storage via SQLite and associated complexity.

I expect that we can serialise the path or keep it in memory and redraw it given this data once the theme has been changed. There should be code in the codebase which does similar for variables.

david-allison avatar Mar 15 '21 04:03 david-allison

Making sure it works across Activity restarts is good enough, and making sure all Activities work across Activity restarts (can be tested by turning off keep activities in developer settings) is much much more important than trying to save whiteboard data across Application restarts. I'm not sure that's even a feature people would want?

Let's leave that for now and focus on Activity restart correctness - e.g. #3654

mikehardy avatar Mar 15 '21 04:03 mikehardy

Yes I agree, we can work as an add-on if user requests it.For now its better to focus more on restart of all activity when theme changes.

imaryandokania avatar Mar 16 '21 03:03 imaryandokania

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar May 15 '21 03:05 github-actions[bot]

Solved with the new whiteboard

BrayanDSO avatar Nov 07 '25 22:11 BrayanDSO