diff --git a/app/build.gradle b/app/build.gradle index c6f2914f5..cb5c04df9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ dependencies { implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' - kapt 'androidx.room:room-compiler:2.0.0' - implementation 'androidx.room:room-runtime:2.0.0' - annotationProcessor 'androidx.room:room-compiler:2.0.0' + kapt 'androidx.room:room-compiler:2.1.0' + implementation 'androidx.room:room-runtime:2.1.0' + annotationProcessor 'androidx.room:room-compiler:2.1.0' } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Converters.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Converters.kt index 3ff78610d..45de469a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Converters.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Converters.kt @@ -9,7 +9,15 @@ class Converters { private val stringType = object : TypeToken>() {}.type @TypeConverter - fun jsonToStringList(value: String) = gson.fromJson>(value, stringType) + fun jsonToStringList(value: String): ArrayList { + val newValue = if (value.isNotEmpty() && !value.startsWith("[")) { + "[$value]" + } else { + value + } + + return gson.fromJson(newValue, stringType) + } @TypeConverter fun stringListToJson(list: ArrayList) = gson.toJson(list) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt index 3f488321e..356d9b660 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt @@ -214,7 +214,8 @@ class EventsHelper(val context: Context) { var repetitionExceptions = parentEvent.repetitionExceptions repetitionExceptions.add(Formatter.getDayCodeFromTS(occurrenceTS)) repetitionExceptions = repetitionExceptions.distinct().toMutableList() as ArrayList - eventsDB.updateEventRepetitionExceptions(repetitionExceptions, parentEventId) + + eventsDB.updateEventRepetitionExceptions(repetitionExceptions.toString(), parentEventId) context.scheduleNextEventReminder(parentEvent, false) if (addToCalDAV && config.caldavSync) { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt index 0c6749744..5a06904ce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt @@ -103,7 +103,7 @@ interface EventsDao { fun updateEventRepetitionLimit(repeatLimit: Long, id: Long) @Query("UPDATE events SET repetition_exceptions = :repetitionExceptions WHERE id = :id") - fun updateEventRepetitionExceptions(repetitionExceptions: ArrayList, id: Long) + fun updateEventRepetitionExceptions(repetitionExceptions: String, id: Long) @Insert(onConflict = OnConflictStrategy.REPLACE) fun insertOrUpdate(event: Event): Long