mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 04:10:45 +01:00
set the default daily rule to EVERY_DAY when daily repetition is selected
This commit is contained in:
parent
c166ce8f1c
commit
cfd40fd486
@ -151,6 +151,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
||||
mRepeatInterval = interval
|
||||
updateRepetitionText()
|
||||
checkRepeatTexts(interval)
|
||||
|
||||
if (mRepeatInterval == DAY) {
|
||||
setRepeatRule(EVERY_DAY)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkRepeatTexts(limit: Int) {
|
||||
@ -190,18 +194,22 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
||||
private fun showRepetitionRuleDialog() {
|
||||
if (mRepeatInterval == DAY) {
|
||||
RepeatRuleDailyDialog(this, mRepeatRule) {
|
||||
mRepeatRule = it
|
||||
checkRepetitionRuleText()
|
||||
if (it == 0) {
|
||||
setRepeatInterval(0)
|
||||
}
|
||||
setRepeatRule(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setRepeatRule(rule: Int) {
|
||||
mRepeatRule = rule
|
||||
checkRepetitionRuleText()
|
||||
if (rule == 0) {
|
||||
setRepeatInterval(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkRepetitionRuleText() {
|
||||
if (mRepeatInterval == DAY) {
|
||||
event_repetition_rule.text = getString(if (mRepeatRule == 127) R.string.every_day else R.string.selected_days)
|
||||
event_repetition_rule.text = getString(if (mRepeatRule == EVERY_DAY) R.string.every_day else R.string.selected_days)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ val THURSDAY = 8
|
||||
val FRIDAY = 16
|
||||
val SATURDAY = 32
|
||||
val SUNDAY = 64
|
||||
val ALL_DAYS = 127
|
||||
val EVERY_DAY = 127
|
||||
|
||||
// repeat_rule for monthly repetition
|
||||
val REPEAT_MONTH_SAME_DAY = 1
|
||||
|
@ -593,7 +593,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
do {
|
||||
val eventId = cursor.getIntValue(COL_EVENT_ID)
|
||||
val interval = cursor.getIntValue(COL_REPEAT_INTERVAL)
|
||||
var rule = ALL_DAYS
|
||||
var rule = EVERY_DAY
|
||||
if (interval == MONTH) {
|
||||
rule = REPEAT_MONTH_SAME_DAY
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user