mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
move event storing in EventActivity in a separate function
This commit is contained in:
@@ -439,7 +439,6 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||||||
val wasRepeatable = mEvent.repeatInterval > 0
|
val wasRepeatable = mEvent.repeatInterval > 0
|
||||||
|
|
||||||
val reminders = sortedSetOf(mReminder1Minutes, mReminder2Minutes, mReminder3Minutes).filter { it != REMINDER_OFF }
|
val reminders = sortedSetOf(mReminder1Minutes, mReminder2Minutes, mReminder3Minutes).filter { it != REMINDER_OFF }
|
||||||
val dbHelper = DBHelper.newInstance(applicationContext, this)
|
|
||||||
val newDescription = event_description.value
|
val newDescription = event_description.value
|
||||||
mEvent.apply {
|
mEvent.apply {
|
||||||
startTS = newStartTS
|
startTS = newStartTS
|
||||||
@@ -460,6 +459,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||||||
source = "Simple Calendar"
|
source = "Simple Calendar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storeEvent(wasRepeatable)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun storeEvent(wasRepeatable: Boolean) {
|
||||||
if (mEvent.id == 0) {
|
if (mEvent.id == 0) {
|
||||||
dbHelper.insert(mEvent) {
|
dbHelper.insert(mEvent) {
|
||||||
if (DateTime.now().isAfter(mEventStartDateTime.millis)) {
|
if (DateTime.now().isAfter(mEventStartDateTime.millis)) {
|
||||||
|
Reference in New Issue
Block a user