From 5d4364eb95ba7f074a1442b43fed2c97e60fc07e Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 20 Sep 2022 13:12:13 +0200 Subject: [PATCH] invoke the change listener in preference dialogs --- .../github/libretube/views/MaterialPreferenceFragment.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt b/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt index ce2a88a25..98838be28 100644 --- a/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt +++ b/app/src/main/java/com/github/libretube/views/MaterialPreferenceFragment.kt @@ -35,8 +35,8 @@ open class MaterialPreferenceFragment : PreferenceFragmentCompat() { preference.value = newValue preference.callChangeListener(newValue) - // dismiss the dialog - dialog.dismiss() + // invoke the on change listeners + preference.callChangeListener(preference.value) } .setNegativeButton(R.string.cancel, null) .show() @@ -55,6 +55,9 @@ open class MaterialPreferenceFragment : PreferenceFragmentCompat() { .setPositiveButton(R.string.okay) { _, _ -> // save the new value preference.text = binding.input.text.toString() + + // invoke the on change listeners + preference.callChangeListener(preference.text) } .setNegativeButton(R.string.cancel, null) .show()