mirror of
https://codeberg.org/timelimit/opentimelimit-android.git
synced 2025-10-05 02:39:34 +02:00
Show warning if time limit rule affects multiple days
This commit is contained in:
parent
1808710e0b
commit
b74350f85f
4 changed files with 24 additions and 1 deletions
|
@ -134,7 +134,9 @@ class EditTimeLimitRuleDialogFragment : BottomSheetDialogFragment() {
|
|||
view.applyToExtraTime = newRule.applyToExtraTimeUsage
|
||||
view.timeSpan.timeInMillis = newRule.maximumTimeInMillis.toLong()
|
||||
|
||||
view.timeSpan.maxDays = Math.max(0, (0..6).map { (newRule.dayMask.toInt() shr it) and 1 }.sum() - 1)
|
||||
val affectedDays = Math.max(0, (0..6).map { (newRule.dayMask.toInt() shr it) and 1 }.sum())
|
||||
view.timeSpan.maxDays = affectedDays - 1
|
||||
view.affectsMultipleDays = affectedDays >= 2
|
||||
}
|
||||
|
||||
bindRule()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue