apply the default calendar reminders where appropriate

This commit is contained in:
tibbi 2017-07-28 22:32:58 +02:00
parent 2da1739431
commit 485b126d51
3 changed files with 7 additions and 1 deletions

View file

@ -392,7 +392,7 @@ class SettingsActivity : SimpleActivity() {
reminderMinutes.add(it.minutes)
}
}
config.googleDefaultReminders = reminderMinutes.joinToString()
config.googleDefaultReminders = reminderMinutes.joinToString(",")
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {

View file

@ -216,6 +216,11 @@ class FetchGoogleEventsTask(val context: Context, val googleSyncListener: Google
reminderMinutes.add(minutes)
}
}
} else if (json?.has(USE_DEFAULT) == true) {
val minutes = context.config.googleDefaultReminders.splitToSequence(',')
minutes.forEach {
reminderMinutes.add(it.toInt())
}
}
return reminderMinutes
}

View file

@ -131,3 +131,4 @@ val OPERATION_UPDATE = 2
val OPERATION_DELETE = 3
val OVERRIDES = "overrides"
val DEFAULT_REMINDERS = "defaultReminders"
val USE_DEFAULT = "useDefault"