From 7e5783afaeb5a131f5d66f29a3b81e0d46d930f1 Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Fri, 24 Dec 2021 13:35:06 +0100 Subject: [PATCH] Fixed custom not being selected --- .../calendar/pro/activities/WidgetListConfigureActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt index a7e2126e1..2d9ec1b7f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt @@ -128,7 +128,9 @@ class WidgetListConfigureActivity : SimpleActivity() { items.add(RadioItem(EVENT_PERIOD_ONE_YEAR, getString(R.string.within_the_next_one_year))) items.add(RadioItem(EVENT_PERIOD_CUSTOM, getString(R.string.within_the_next))) - RadioGroupDialog(this, items, selectedPeriodOption, showOKButton = true, cancelCallback = null) { + val selectedOption = if (items.any { it.id === selectedPeriodOption }) selectedPeriodOption else EVENT_PERIOD_CUSTOM + + RadioGroupDialog(this, items, selectedOption, showOKButton = true, cancelCallback = null) { val option = it as Int if (option == EVENT_PERIOD_CUSTOM) { CustomPeriodPickerDialog(this, selectedPeriodValue, selectedPeriodValueType) { value: Int, type: Int ->