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) {
showSaveButton = newText != mCurrentNote.value
if (showSaveButton != saveNoteButton?.isVisible) {
invalidateOptionsMenu()
if (!config.autosaveNotes) {
showSaveButton = newText != mCurrentNote.value
if (showSaveButton != saveNoteButton?.isVisible) {
invalidateOptionsMenu()
}
}
}

View File

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