From 7a3d7546e7fa8763ddbcd877a53cee740c055bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Tue, 12 Sep 2023 12:10:05 +0200 Subject: [PATCH] Make current unit selected in dialog for selecting unit --- .../com/simplemobiletools/calculator/views/ConverterView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/views/ConverterView.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/views/ConverterView.kt index 912de22b..d8bc93b8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/views/ConverterView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/views/ConverterView.kt @@ -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()