fix charging plans selection in Android Auto/Automotive

fixes #182
This commit is contained in:
johan12345
2022-06-22 22:23:56 +02:00
parent e70ab68ff8
commit 096ef902b7

View File

@@ -221,8 +221,12 @@ class SelectTariffsScreen(ctx: CarContext) : MultiSelectSearchScreen<Chargeprice
}
if (isSelected(item)) {
prefs.chargepriceMyTariffs = tariffs.minus(item.id)
prefs.chargepriceMyTariffsAll = false
} else {
prefs.chargepriceMyTariffs = tariffs.plus(item.id)
if (prefs.chargepriceMyTariffs == fullList!!.map { it.id }.toSet()) {
prefs.chargepriceMyTariffsAll = true
}
}
}