adding an extra check to avoid setting during day reminders to non-all-day events

This commit is contained in:
tibbi 2021-02-12 16:11:53 +01:00
parent ac336b64d1
commit effbe4d330
4 changed files with 20 additions and 6 deletions

View File

@ -17,7 +17,7 @@ insert_final_newline = true
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
continuation_indent_size = 8 continuation_indent_size = 4
[*.xml] [*.xml]
continuation_indent_size = 4 continuation_indent_size = 4

View File

@ -64,7 +64,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.33.20' implementation 'com.simplemobiletools:commons:5.33.26'
implementation 'joda-time:joda-time:2.10.1' implementation 'joda-time:joda-time:2.10.1'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

View File

@ -1060,6 +1060,20 @@ class EventActivity : SimpleActivity() {
} }
val reminders = getReminders() val reminders = getReminders()
if (!event_all_day.isChecked) {
if (reminders.getOrNull(2)?.minutes ?: 0 < -1) {
reminders.removeAt(2)
}
if (reminders.getOrNull(1)?.minutes ?: 0 < -1) {
reminders.removeAt(1)
}
if (reminders.getOrNull(0)?.minutes ?: 0 < -1) {
reminders.removeAt(0)
}
}
val reminder1 = reminders.getOrNull(0) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION) val reminder1 = reminders.getOrNull(0) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION)
val reminder2 = reminders.getOrNull(1) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION) val reminder2 = reminders.getOrNull(1) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION)
val reminder3 = reminders.getOrNull(2) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION) val reminder3 = reminders.getOrNull(2) ?: Reminder(REMINDER_OFF, REMINDER_NOTIFICATION)

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.4.21' ext.kotlin_version = '1.4.30'
repositories { repositories {
google() google()