diff --git a/app/src/main/java/androidx/preference/EditTextPreferenceExtensions.kt b/app/src/main/java/androidx/preference/EditTextPreferenceExtensions.kt new file mode 100644 index 000000000..0a3c817e3 --- /dev/null +++ b/app/src/main/java/androidx/preference/EditTextPreferenceExtensions.kt @@ -0,0 +1,8 @@ +package androidx.preference + +/** + * Returns package-private [EditTextPreference.getOnBindEditTextListener] + */ +fun EditTextPreference.getOnBindEditTextListener(): EditTextPreference.OnBindEditTextListener? { + return onBindEditTextListener +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesController.kt index f2b1f81a6..3b726b23d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesController.kt @@ -19,6 +19,7 @@ import androidx.preference.Preference import androidx.preference.PreferenceGroupAdapter import androidx.preference.PreferenceManager import androidx.preference.PreferenceScreen +import androidx.preference.getOnBindEditTextListener import androidx.recyclerview.widget.LinearLayoutManager import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.SharedPreferencesDataStore @@ -117,7 +118,9 @@ class SourcePreferencesController(bundle: Bundle? = null) : // Apply incognito IME for EditTextPreference if (pref is EditTextPreference) { + val setListener = pref.getOnBindEditTextListener() pref.setOnBindEditTextListener { + setListener?.onBindEditText(it) it.setIncognito(viewScope) } }