Fixed custom not being selected

This commit is contained in:
Agnieszka C 2021-12-24 13:35:06 +01:00
parent bde9a497dc
commit 7e5783afae
1 changed files with 3 additions and 1 deletions

View File

@ -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 ->