From c071d360a558aa777118a1cc3456c74711452771 Mon Sep 17 00:00:00 2001 From: MiMoHo <37556964+MiMoHo@users.noreply.github.com> Date: Fri, 3 Jul 2026 20:56:40 +0200 Subject: [PATCH] fix: refresh in-memory text note value after manual save When autosave is off, saveCurrentNote() updated mCurrentNote.value only for checklists, leaving the stale pre-save text for TYPE_TEXT notes. Since mCurrentNote is the same object reference as mNotes[currentItem], swiping away and back triggered setMenuVisibility -> currentNoteTextChanged, which recomputed showSaveButton from the stale value and made the Save icon reappear on an already-saved note. Add the symmetric else branch so the text note's value is refreshed from the current EditText content after a save, keeping it in sync so the swipe-back recomputation correctly yields false. Fixes #210 --- CHANGELOG.md | 3 +++ .../main/kotlin/org/fossify/notes/activities/MainActivity.kt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a7cde17..345ec795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fixed the Save icon reappearing on an already-saved note after swiping between notes with autosave turned off ([#210]) ## [1.7.0] - 2026-01-30 ### Added @@ -115,6 +117,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#178]: https://github.com/FossifyOrg/Notes/issues/178 [#190]: https://github.com/FossifyOrg/Notes/issues/190 [#201]: https://github.com/FossifyOrg/Notes/issues/201 +[#210]: https://github.com/FossifyOrg/Notes/issues/210 [#291]: https://github.com/FossifyOrg/Notes/issues/291 [Unreleased]: https://github.com/FossifyOrg/Notes/compare/1.7.0...HEAD diff --git a/app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt b/app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt index 72577845..05c86b70 100644 --- a/app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt +++ b/app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt @@ -1342,6 +1342,8 @@ class MainActivity : SimpleActivity() { if (mCurrentNote.type == NoteType.TYPE_CHECKLIST) { mCurrentNote.value = getPagerAdapter() .getNoteChecklistItems(binding.viewPager.currentItem) ?: "" + } else { + mCurrentNote.value = getCurrentNoteText() ?: mCurrentNote.value } }