remove some code repetition

This commit is contained in:
tibbi 2016-11-19 17:21:54 +01:00
parent 98e1508a88
commit 1337340896
1 changed files with 10 additions and 8 deletions

View File

@ -138,14 +138,16 @@ class EventActivity : SimpleActivity(), DBHelper.EventsListener {
}
private fun setupRepetition() {
event_repetition.setSelection(
when (mEvent.repeatInterval) {
DAY -> event_repetition.setSelection(1)
WEEK -> event_repetition.setSelection(2)
BIWEEK -> event_repetition.setSelection(3)
MONTH -> event_repetition.setSelection(4)
YEAR -> event_repetition.setSelection(5)
else -> event_repetition.setSelection(0)
DAY -> 1
WEEK -> 2
BIWEEK -> 3
MONTH -> 4
YEAR -> 5
else -> 0
}
)
}
private fun setupEndCheckbox() {