always notify the given activity of text change

This commit is contained in:
tibbi 2018-07-17 19:59:40 +02:00
parent bc6cb492ef
commit 48f31b8d83
2 changed files with 6 additions and 8 deletions

View File

@ -564,9 +564,11 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
} }
fun currentNoteTextChanged(newText: String) { fun currentNoteTextChanged(newText: String) {
showSaveButton = newText != mCurrentNote.value if (!config.autosaveNotes) {
if (showSaveButton != saveNoteButton?.isVisible) { showSaveButton = newText != mCurrentNote.value
invalidateOptionsMenu() if (showSaveButton != saveNoteButton?.isVisible) {
invalidateOptionsMenu()
}
} }
} }

View File

@ -87,11 +87,7 @@ class NoteFragment : Fragment() {
view.notes_counter.beGone() view.notes_counter.beGone()
} }
if (config.showWordCount || !config.autosaveNotes) { view.notes_view.addTextChangedListener(textWatcher)
view.notes_view.addTextChangedListener(textWatcher)
} else {
view.notes_view.removeTextChangedListener(textWatcher)
}
} }
override fun onPause() { override fun onPause() {