Make current unit selected in dialog for selecting unit

This commit is contained in:
Ensar Sarajčić
2023-09-12 12:10:05 +02:00
parent 746874ff2a
commit 7a3d7546e7

View File

@ -173,7 +173,7 @@ class ConverterView @JvmOverloads constructor(
val items = ArrayList(converter!!.units.mapIndexed { index, unit ->
RadioItem(index, context.getString(unit.nameResId), unit)
})
RadioGroupDialog(context as Activity, items) {
RadioGroupDialog(context as Activity, items, converter!!.units.indexOf(propertyToChange.get())) {
val unit = it as Converter.Unit
if (unit == otherProperty.get()) {
switch()