disable myTariffsPreference until tariffs are loaded

This commit is contained in:
johan12345
2021-07-03 11:32:37 +02:00
parent 6a7b7a7d39
commit 72b2b34af3

View File

@@ -61,6 +61,7 @@ class SettingsFragment : PreferenceFragmentCompat(),
}
myTariffsPreference = findPreference("chargeprice_my_tariffs")!!
myTariffsPreference.isEnabled = false
vm.tariffs.observe(viewLifecycleOwner) { res ->
res.data?.let { tariffs ->
myTariffsPreference.entryValues = tariffs.map { it.id }.toTypedArray()