diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 65b7073a5..a715c50a7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,16 +1,15 @@ - - - - - - - + + + + + + + tools:node="remove" /> + android:required="false" /> + android:theme="@style/SplashTheme" /> + android:resource="@xml/searchable" /> - + - - + + - - - - - + + + + + - - + + - - - + + + - - - + + + @@ -81,7 +80,7 @@ android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> - + @@ -90,7 +89,7 @@ android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> - + @@ -99,29 +98,29 @@ android:screenOrientation="portrait" android:theme="@style/MyWidgetConfigTheme"> - + + android:parentActivityName=".activities.MainActivity" /> + android:parentActivityName=".activities.SettingsActivity" /> + android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" /> + android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" /> - - + + - - + + - - + + - - + + @@ -160,28 +159,28 @@ + android:parentActivityName=".activities.MainActivity" /> + android:parentActivityName=".activities.SettingsActivity" /> + android:theme="@style/Theme.Transparent" /> - + + android:resource="@xml/widget_monthly_info" /> - + + android:resource="@xml/widget_list_info" /> - + + android:resource="@xml/widget_date_info" /> + android:permission="android.permission.BIND_REMOTEVIEWS" /> + android:permission="android.permission.BIND_REMOTEVIEWS" /> - + + android:permission="android.permission.BIND_JOB_SERVICE" /> - + - + - - - + + + @@ -244,7 +243,7 @@ android:grantUriPermissions="true"> + android:resource="@xml/provider_paths" /> - - + + @@ -268,8 +267,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -281,8 +280,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -294,8 +293,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -307,8 +306,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -320,8 +319,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -333,8 +332,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -346,8 +345,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -359,8 +358,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -372,8 +371,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -385,8 +384,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -398,8 +397,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -411,8 +410,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -424,8 +423,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -436,8 +435,8 @@ android:roundIcon="@mipmap/ic_launcher" android:targetActivity=".activities.SplashActivity"> - - + + @@ -449,8 +448,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -462,8 +461,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -475,8 +474,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + @@ -488,8 +487,8 @@ android:targetActivity=".activities.SplashActivity"> - - + + diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt index 31ff3a369..d2fe2bdde 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt @@ -169,9 +169,9 @@ class IcsImporter(val activity: SimpleActivity) { } var reminders = arrayListOf( - Reminder(curReminderMinutes.getOrElse(0) { REMINDER_OFF }, curReminderActions.getOrElse(0) { REMINDER_NOTIFICATION }), - Reminder(curReminderMinutes.getOrElse(1) { REMINDER_OFF }, curReminderActions.getOrElse(1) { REMINDER_NOTIFICATION }), - Reminder(curReminderMinutes.getOrElse(2) { REMINDER_OFF }, curReminderActions.getOrElse(2) { REMINDER_NOTIFICATION }) + Reminder(curReminderMinutes.getOrElse(0) { REMINDER_OFF }, curReminderActions.getOrElse(0) { REMINDER_NOTIFICATION }), + Reminder(curReminderMinutes.getOrElse(1) { REMINDER_OFF }, curReminderActions.getOrElse(1) { REMINDER_NOTIFICATION }), + Reminder(curReminderMinutes.getOrElse(2) { REMINDER_OFF }, curReminderActions.getOrElse(2) { REMINDER_NOTIFICATION }) ) reminders = reminders.sortedBy { it.minutes }.sortedBy { it.minutes == REMINDER_OFF }.toMutableList() as ArrayList @@ -179,8 +179,8 @@ class IcsImporter(val activity: SimpleActivity) { val eventType = eventTypes.firstOrNull { it.id == curEventTypeId } val source = if (calDAVCalendarId == 0 || eventType?.isSyncedEventType() == false) SOURCE_IMPORTED_ICS else "$CALDAV-$calDAVCalendarId" val event = Event(null, curStart, curEnd, curTitle, curLocation, curDescription, reminders[0].minutes, - reminders[1].minutes, reminders[2].minutes, reminders[0].type, reminders[1].type, reminders[2].type, curRepeatInterval, curRepeatRule, - curRepeatLimit, curRepeatExceptions, "", curImportId, DateTimeZone.getDefault().id, curFlags, curEventTypeId, 0, curLastModified, source) + reminders[1].minutes, reminders[2].minutes, reminders[0].type, reminders[1].type, reminders[2].type, curRepeatInterval, curRepeatRule, + curRepeatLimit, curRepeatExceptions, "", curImportId, DateTimeZone.getDefault().id, curFlags, curEventTypeId, 0, curLastModified, source) if (event.getIsAllDay() && curEnd > curStart) { event.endTS -= DAY diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Event.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Event.kt index 5f8df9041..ecedb5f91 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Event.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Event.kt @@ -14,30 +14,30 @@ import java.io.Serializable @Entity(tableName = "events", indices = [(Index(value = ["id"], unique = true))]) data class Event( - @PrimaryKey(autoGenerate = true) var id: Long?, - @ColumnInfo(name = "start_ts") var startTS: Long = 0L, - @ColumnInfo(name = "end_ts") var endTS: Long = 0L, - @ColumnInfo(name = "title") var title: String = "", - @ColumnInfo(name = "location") var location: String = "", - @ColumnInfo(name = "description") var description: String = "", - @ColumnInfo(name = "reminder_1_minutes") var reminder1Minutes: Int = -1, - @ColumnInfo(name = "reminder_2_minutes") var reminder2Minutes: Int = -1, - @ColumnInfo(name = "reminder_3_minutes") var reminder3Minutes: Int = -1, - @ColumnInfo(name = "reminder_1_type") var reminder1Type: Int = REMINDER_NOTIFICATION, - @ColumnInfo(name = "reminder_2_type") var reminder2Type: Int = REMINDER_NOTIFICATION, - @ColumnInfo(name = "reminder_3_type") var reminder3Type: Int = REMINDER_NOTIFICATION, - @ColumnInfo(name = "repeat_interval") var repeatInterval: Int = 0, - @ColumnInfo(name = "repeat_rule") var repeatRule: Int = 0, - @ColumnInfo(name = "repeat_limit") var repeatLimit: Long = 0L, - @ColumnInfo(name = "repetition_exceptions") var repetitionExceptions: ArrayList = ArrayList(), - @ColumnInfo(name = "attendees") var attendees: String = "", - @ColumnInfo(name = "import_id") var importId: String = "", - @ColumnInfo(name = "time_zone") var timeZone: String = "", - @ColumnInfo(name = "flags") var flags: Int = 0, - @ColumnInfo(name = "event_type") var eventType: Long = REGULAR_EVENT_TYPE_ID, - @ColumnInfo(name = "parent_id") var parentId: Long = 0, - @ColumnInfo(name = "last_updated") var lastUpdated: Long = 0L, - @ColumnInfo(name = "source") var source: String = SOURCE_SIMPLE_CALENDAR) + @PrimaryKey(autoGenerate = true) var id: Long?, + @ColumnInfo(name = "start_ts") var startTS: Long = 0L, + @ColumnInfo(name = "end_ts") var endTS: Long = 0L, + @ColumnInfo(name = "title") var title: String = "", + @ColumnInfo(name = "location") var location: String = "", + @ColumnInfo(name = "description") var description: String = "", + @ColumnInfo(name = "reminder_1_minutes") var reminder1Minutes: Int = -1, + @ColumnInfo(name = "reminder_2_minutes") var reminder2Minutes: Int = -1, + @ColumnInfo(name = "reminder_3_minutes") var reminder3Minutes: Int = -1, + @ColumnInfo(name = "reminder_1_type") var reminder1Type: Int = REMINDER_NOTIFICATION, + @ColumnInfo(name = "reminder_2_type") var reminder2Type: Int = REMINDER_NOTIFICATION, + @ColumnInfo(name = "reminder_3_type") var reminder3Type: Int = REMINDER_NOTIFICATION, + @ColumnInfo(name = "repeat_interval") var repeatInterval: Int = 0, + @ColumnInfo(name = "repeat_rule") var repeatRule: Int = 0, + @ColumnInfo(name = "repeat_limit") var repeatLimit: Long = 0L, + @ColumnInfo(name = "repetition_exceptions") var repetitionExceptions: ArrayList = ArrayList(), + @ColumnInfo(name = "attendees") var attendees: String = "", + @ColumnInfo(name = "import_id") var importId: String = "", + @ColumnInfo(name = "time_zone") var timeZone: String = "", + @ColumnInfo(name = "flags") var flags: Int = 0, + @ColumnInfo(name = "event_type") var eventType: Long = REGULAR_EVENT_TYPE_ID, + @ColumnInfo(name = "parent_id") var parentId: Long = 0, + @ColumnInfo(name = "last_updated") var lastUpdated: Long = 0L, + @ColumnInfo(name = "source") var source: String = SOURCE_SIMPLE_CALENDAR) : Serializable { companion object { @@ -123,9 +123,9 @@ data class Event( fun getIsAllDay() = flags and FLAG_ALL_DAY != 0 fun getReminders() = setOf( - Reminder(reminder1Minutes, reminder1Type), - Reminder(reminder2Minutes, reminder2Type), - Reminder(reminder3Minutes, reminder3Type) + Reminder(reminder1Minutes, reminder1Type), + Reminder(reminder2Minutes, reminder2Type), + Reminder(reminder3Minutes, reminder3Type) ).filter { it.minutes != REMINDER_OFF } // properly return the start time of all-day events as midnight