Add IME_FLAG_NO_PERSONALIZED_LEARNING flag to text input when incognito is enabled (#5801)

* Add IME_FLAG_NO_PERSONALIZED_LEARNING flag to text input when incognito is enabled

Tested with Gboard only.

* Revert "Add IME_FLAG_NO_PERSONALIZED_LEARNING flag to text input when incognito is enabled"

This reverts commit 068399db

* Add IME_FLAG_NO_PERSONALIZED_LEARNING flag to text inputs when incognito is enabled

Source preference is not affected.

* Source preference stuff
This commit is contained in:
Ivan Iskandar
2021-08-28 23:06:29 +07:00
committed by GitHub
parent 7fa80ae556
commit 3ea84cf0ce
15 changed files with 128 additions and 13 deletions

View File

@@ -27,6 +27,7 @@ import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.getPreferenceKey
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.widget.TachiyomiTextInputEditText.Companion.setIncognito
import timber.log.Timber
@SuppressLint("RestrictedApi")
@@ -113,6 +114,13 @@ class SourcePreferencesController(bundle: Bundle? = null) :
pref.isIconSpaceReserved = false
pref.order = Int.MAX_VALUE // reset to default order
// Apply incognito IME for EditTextPreference
if (pref is EditTextPreference) {
pref.setOnBindEditTextListener {
it.setIncognito(viewScope)
}
}
newScreen.removePreference(pref)
screen.addPreference(pref)
}