diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt
index a840d5a97..98bc1c5eb 100644
--- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt
@@ -153,7 +153,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
checkRepeatTexts(interval)
if (mRepeatInterval == DAY) {
- setRepeatRule(EVERY_DAY)
+ setRepeatRule(config.defaultDailyRepetition)
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt
index f7e7cc8a2..a3839863f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt
@@ -7,9 +7,11 @@ import android.net.Uri
import android.os.Bundle
import android.os.Parcelable
import com.simplemobiletools.calendar.R
+import com.simplemobiletools.calendar.dialogs.RepeatRuleDailyDialog
import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.extensions.getReminderText
+import com.simplemobiletools.calendar.helpers.EVERY_DAY
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
@@ -50,6 +52,7 @@ class SettingsActivity : SimpleActivity() {
setupWeeklyEnd()
setupVibrate()
setupReminderSound()
+ setupDailyRepetition()
setupEventReminder()
updateTextColors(settings_holder)
checkPrimaryColor()
@@ -184,6 +187,20 @@ class SettingsActivity : SimpleActivity() {
}
}
+ private fun setupDailyRepetition() {
+ updateDailyRepetitionText()
+ settings_default_daily_repetition_holder.setOnClickListener {
+ RepeatRuleDailyDialog(this, config.defaultDailyRepetition) {
+ config.defaultDailyRepetition = it
+ updateDailyRepetitionText()
+ }
+ }
+ }
+
+ private fun updateDailyRepetitionText() {
+ settings_default_daily_repetition.text = getString(if (config.defaultDailyRepetition == EVERY_DAY) R.string.every_day else R.string.selected_days)
+ }
+
private fun setupEventReminder() {
var reminderMinutes = config.defaultReminderMinutes
settings_default_reminder.text = getReminderText(reminderMinutes)
diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt
index cb4fdeef5..8bef4cc15 100644
--- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt
@@ -49,6 +49,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getInt(VIEW, MONTHLY_VIEW)
set(view) = prefs.edit().putInt(VIEW, view).apply()
+ var defaultDailyRepetition: Int
+ get() = prefs.getInt(DAILY_REPETITION, EVERY_DAY)
+ set(dailyRepetition) = prefs.edit().putInt(DAILY_REPETITION, dailyRepetition).apply()
+
var defaultReminderMinutes: Int
get() = prefs.getInt(REMINDER_MINUTES, 10)
set(mins) = prefs.edit().putInt(REMINDER_MINUTES, mins).apply()
diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt
index 415f9dfd2..8ee4ed75f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt
@@ -39,6 +39,7 @@ val END_WEEKLY_AT = "end_weekly_at"
val VIBRATE = "vibrate"
val REMINDER_SOUND = "reminder_sound"
val VIEW = "view"
+val DAILY_REPETITION = "daily_repetition"
val REMINDER_MINUTES = "reminder_minutes"
val DISPLAY_EVENT_TYPES = "display_event_types"
val GOOGLE_SYNC = "google_sync"
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index 780d94fce..80c7704ed 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -255,6 +255,41 @@
+
+
+
+
+
+
+
+
Widerholung
Täglich
an ausgewählten Tagen
+ Default daily repetition
jeden Monat am selben Tag
am letzten Tag des Monat
jeden
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 82881b9f7..06432c177 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 4764c6d14..b7bf2ee0d 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml
index c18a89b45..2215ed8b6 100644
--- a/app/src/main/res/values-hi-rIN/strings.xml
+++ b/app/src/main/res/values-hi-rIN/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 58d830e11..17bdf84fb 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 232414baa..9b0a45fa3 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml
index 40a0357ea..66b4360bf 100644
--- a/app/src/main/res/values-iw/strings.xml
+++ b/app/src/main/res/values-iw/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 9fa77ee19..94a90fd35 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 66cd70397..622796956 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 35f0fc1f4..1df85f606 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index e312b4b13..97a9823a0 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index cf0dea2f0..3366264f3 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -49,6 +49,7 @@
Opakovať
Každý deň
Vo vybraných dňoch
+ Predvolené denné opakovanie
Každý mesiac v rovnaký deň
Posledný deň v mesiaci
Každý
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 15f75b655..bcfb57557 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 44dc6b06c..f815e2694 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -49,6 +49,7 @@
Repeat
Every day
On selected days
+ Default daily repetition
On the same day every month
On the last day of the month
Every