-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: instant note editor to restore text when orientation changes #17935
fix: instant note editor to restore text when orientation changes #17935
Conversation
c75a4a7
to
8be3bec
Compare
8be3bec
to
bb86519
Compare
This comment was marked as resolved.
This comment was marked as resolved.
fcd603c
to
aa94be2
Compare
aa94be2
to
8cc84a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this introduces a bug if the activity is destroyed when being backgrounded. Could you check with Don't keep Activities
AnkiDroid/src/main/java/com/ichi2/anki/instantnoteeditor/InstantNoteEditorActivity.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/instantnoteeditor/InstantNoteEditorActivity.kt
Outdated
Show resolved
Hide resolved
8cc84a7
to
01a2d6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor requested refactor
AnkiDroid/src/main/java/com/ichi2/anki/instantnoteeditor/InstantNoteEditorActivity.kt
Outdated
Show resolved
Hide resolved
01a2d6b
to
18cb81f
Compare
Purpose / Description
The instant note editor re-init the view model cloze text to the raw text in case of orientation change and we want to avoid it and populate the fields/chips with the original text, hence save and restore the cloze text in case its changed
Approach
Use
savedInstanceState
How Has This Been Tested?
Before:
Screen_recording_20250208_021505.webm
After:
Screen_recording_20250208_021425.webm
Checklist
Please, go through these checks before submitting the PR.