Skip to content
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

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

criticalAY
Copy link
Contributor

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.

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

@criticalAY criticalAY force-pushed the instant-editor-orientation branch from c75a4a7 to 8be3bec Compare February 7, 2025 21:27
@criticalAY criticalAY force-pushed the instant-editor-orientation branch from 8be3bec to bb86519 Compare February 7, 2025 21:59
BrayanDSO

This comment was marked as resolved.

@BrayanDSO BrayanDSO added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Feb 7, 2025
@criticalAY

This comment was marked as resolved.

@criticalAY criticalAY force-pushed the instant-editor-orientation branch 2 times, most recently from fcd603c to aa94be2 Compare February 8, 2025 09:08
@criticalAY criticalAY added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Feb 8, 2025
@criticalAY criticalAY force-pushed the instant-editor-orientation branch from aa94be2 to 8cc84a7 Compare February 8, 2025 18:45
Copy link
Member

@david-allison david-allison left a 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

Copy link
Member

@david-allison david-allison left a 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

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Feb 9, 2025
@criticalAY criticalAY force-pushed the instant-editor-orientation branch from 01a2d6b to 18cb81f Compare February 9, 2025 18:39
@criticalAY criticalAY requested a review from BrayanDSO February 9, 2025 18:39
@BrayanDSO BrayanDSO enabled auto-merge February 9, 2025 18:40
@BrayanDSO BrayanDSO added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Feb 9, 2025
@BrayanDSO BrayanDSO added this pull request to the merge queue Feb 9, 2025
Merged via the queue into ankidroid:main with commit 3b74b3d Feb 9, 2025
9 checks passed
@github-actions github-actions bot added this to the 2.21 release milestone Feb 9, 2025
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants