From c166ce8f1c5f787ba4be5bb83fbc3da69be8602d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 15 Apr 2017 12:31:23 +0200 Subject: [PATCH] disable repetition if no day is selected --- .../calendar/activities/EventActivity.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index 26fac147f..4c11ba39a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -143,12 +143,16 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener { private fun showRepeatIntervalDialog() { showEventRepeatIntervalDialog(mRepeatInterval) { - mRepeatInterval = it - updateRepetitionText() - checkRepeatTexts(it) + setRepeatInterval(it) } } + private fun setRepeatInterval(interval: Int) { + mRepeatInterval = interval + updateRepetitionText() + checkRepeatTexts(interval) + } + private fun checkRepeatTexts(limit: Int) { event_repetition_limit_holder.beGoneIf(limit == 0) checkRepetitionLimitText() @@ -188,6 +192,9 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener { RepeatRuleDailyDialog(this, mRepeatRule) { mRepeatRule = it checkRepetitionRuleText() + if (it == 0) { + setRepeatInterval(0) + } } } }