Skip to content

Conversation

@Vatsuki
Copy link

@Vatsuki Vatsuki commented Dec 27, 2025

Hello, I have fixed the issue Dialog view is destroyed (state not preserved) when rotating the screen. #744 for the Notes application. I hope my contribution is correct. Let me know if I have to change something ^^

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Replaced NewChecklistItemDialog and EditTaskDialog classes with ChecklistItemDialogFragment that inherits from DialogFragment.
  • Implemented onSaveInstanceState to manually save/restore the text of rows. This was necessary because the dynamic rows share the same XML View ID, which confused the automatic state restoration.
  • Replaced the previous lambda callbacks with setFragmentResult and setFragmentResultListener to safely pass data back to TasksFragment after the fragment recreation.

Tests performed

Tested on :

  • Android Studio emulated "Medium Phone",
  • Android 16,
  • API 36.1
  • White and Dark theme
  • Maximized font size, display size in accessibility settings

Before & after preview

Before :
Check the original issue #744

After :

output.mp4

Closes the following issue(s)

FossifyOrg/General-Discussion#744 for the Notes applications

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • All checks are passing.

@Vatsuki Vatsuki requested a review from naveensingh as a code owner December 27, 2025 14:19
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.

1 participant