mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix some prefs
This commit is contained in:
parent
845b6fe2ad
commit
6e663cff41
@ -36,7 +36,10 @@ open class MaterialPreferenceFragment : PreferenceFragmentCompat() {
|
|||||||
preference.callChangeListener(newValue)
|
preference.callChangeListener(newValue)
|
||||||
|
|
||||||
// invoke the on change listeners
|
// invoke the on change listeners
|
||||||
preference.callChangeListener(preference.value)
|
if (preference.callChangeListener(newValue)) {
|
||||||
|
preference.value = newValue
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.show()
|
.show()
|
||||||
@ -52,14 +55,13 @@ open class MaterialPreferenceFragment : PreferenceFragmentCompat() {
|
|||||||
MaterialAlertDialogBuilder(requireContext())
|
MaterialAlertDialogBuilder(requireContext())
|
||||||
.setTitle(preference.title)
|
.setTitle(preference.title)
|
||||||
.setView(binding.root)
|
.setView(binding.root)
|
||||||
.setPositiveButton(R.string.okay) { _, _ ->
|
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||||
// save the new value
|
val newValue = binding.input.text.toString()
|
||||||
preference.text = binding.input.text.toString()
|
if (preference.callChangeListener(newValue)) {
|
||||||
|
preference.text = newValue
|
||||||
// invoke the on change listeners
|
}
|
||||||
preference.callChangeListener(preference.text)
|
|
||||||
}
|
}
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user