fix bolus timer

This commit is contained in:
Milos Kozak 2022-01-02 14:57:39 +01:00
parent d2339f88c2
commit faca82f6e8
4 changed files with 4 additions and 4 deletions

View file

@ -348,7 +348,7 @@ class CarbsDialog : DialogFragmentWithDate() {
})
}
if (useAlarm && carbs > 0 && timeOffset > 0) {
carbTimer.scheduleReminder(T.mins(timeOffset.toLong()).secs())
carbTimer.scheduleReminder(T.mins(timeOffset.toLong()).secs().toInt())
}
}, null)
}

View file

@ -24,7 +24,7 @@ class CarbTimer @Inject constructor(
private val timerUtil: TimerUtil
) {
fun scheduleReminder(seconds: Long, text: String? = null) =
fun scheduleReminder(seconds: Int, text: String? = null) =
timerUtil.scheduleReminder(seconds, text ?: rh.gs(R.string.timetoeat))
fun scheduleEatReminder() {

View file

@ -456,7 +456,7 @@ class BolusWizard @Inject constructor(
}
if (useAlarm && carbs > 0 && carbTime > 0) {
carbTimer.scheduleReminder(T.mins(carbTime.toLong()).secs())
carbTimer.scheduleReminder(T.mins(carbTime.toLong()).secs().toInt())
}
}
})

View file

@ -18,7 +18,7 @@ class TimerUtil @Inject constructor(
/**
* Schedule alarm in @seconds
*/
fun scheduleReminder(seconds: Long, text: String) {
fun scheduleReminder(seconds: Int, text: String) {
Intent(AlarmClock.ACTION_SET_TIMER).apply {
flags = flags or Intent.FLAG_ACTIVITY_NEW_TASK
putExtra(AlarmClock.EXTRA_LENGTH, seconds)