moving Event storing functions on a background thread too

This commit is contained in:
tibbi
2018-11-11 23:46:44 +01:00
parent 34778bb56a
commit 6ec9792aa0

View File

@ -765,7 +765,9 @@ class EventActivity : SimpleActivity() {
mEvent.id = 0
}
Thread {
storeEvent(wasRepeatable)
}.start()
}
private fun storeEvent(wasRepeatable: Boolean) {
@ -781,6 +783,18 @@ class EventActivity : SimpleActivity() {
}
} else {
if (mRepeatInterval > 0 && wasRepeatable) {
runOnUiThread {
showEditRepeatingEventDialog()
}
} else {
dbHelper.update(mEvent, true, this) {
finish()
}
}
}
}
private fun showEditRepeatingEventDialog() {
EditRepeatingEventDialog(this) {
if (it) {
dbHelper.update(mEvent, true, this) {
@ -801,12 +815,6 @@ class EventActivity : SimpleActivity() {
}
}
}
} else {
dbHelper.update(mEvent, true, this) {
finish()
}
}
}
}
private fun updateStartTexts() {