mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
moving Event storing functions on a background thread too
This commit is contained in:
@ -765,7 +765,9 @@ class EventActivity : SimpleActivity() {
|
|||||||
mEvent.id = 0
|
mEvent.id = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
storeEvent(wasRepeatable)
|
Thread {
|
||||||
|
storeEvent(wasRepeatable)
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun storeEvent(wasRepeatable: Boolean) {
|
private fun storeEvent(wasRepeatable: Boolean) {
|
||||||
@ -781,25 +783,8 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mRepeatInterval > 0 && wasRepeatable) {
|
if (mRepeatInterval > 0 && wasRepeatable) {
|
||||||
EditRepeatingEventDialog(this) {
|
runOnUiThread {
|
||||||
if (it) {
|
showEditRepeatingEventDialog()
|
||||||
dbHelper.update(mEvent, true, this) {
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true)
|
|
||||||
mEvent.apply {
|
|
||||||
parentId = id!!.toLong()
|
|
||||||
id = null
|
|
||||||
repeatRule = 0
|
|
||||||
repeatInterval = 0
|
|
||||||
repeatLimit = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
dbHelper.insert(mEvent, true, this) {
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dbHelper.update(mEvent, true, this) {
|
dbHelper.update(mEvent, true, this) {
|
||||||
@ -809,6 +794,29 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showEditRepeatingEventDialog() {
|
||||||
|
EditRepeatingEventDialog(this) {
|
||||||
|
if (it) {
|
||||||
|
dbHelper.update(mEvent, true, this) {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true)
|
||||||
|
mEvent.apply {
|
||||||
|
parentId = id!!.toLong()
|
||||||
|
id = null
|
||||||
|
repeatRule = 0
|
||||||
|
repeatInterval = 0
|
||||||
|
repeatLimit = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
dbHelper.insert(mEvent, true, this) {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateStartTexts() {
|
private fun updateStartTexts() {
|
||||||
updateStartDateText()
|
updateStartDateText()
|
||||||
updateStartTimeText()
|
updateStartTimeText()
|
||||||
|
Reference in New Issue
Block a user