Fix adding one minute to a complete alarm
This commit is contained in:
parent
24e7ee58d9
commit
97442bc292
|
@ -72,6 +72,14 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
|
||||||
countdownTimer = getTimer(newMs, vibrate, sound, noSound)
|
countdownTimer = getTimer(newMs, vibrate, sound, noSound)
|
||||||
countdownTimer?.start()
|
countdownTimer?.start()
|
||||||
running = true
|
running = true
|
||||||
|
val manager = getManager()
|
||||||
|
manager.cancel(NOTIFICATION_ID_DONE)
|
||||||
|
reactApplicationContext.stopService(
|
||||||
|
Intent(
|
||||||
|
reactApplicationContext,
|
||||||
|
AlarmService::class.java
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
@ -146,7 +154,12 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
private fun getTimer(endMs: Int, vibrate: Boolean, sound: String?, noSound: Boolean): CountDownTimer {
|
private fun getTimer(
|
||||||
|
endMs: Int,
|
||||||
|
vibrate: Boolean,
|
||||||
|
sound: String?,
|
||||||
|
noSound: Boolean
|
||||||
|
): CountDownTimer {
|
||||||
val builder = getBuilder()
|
val builder = getBuilder()
|
||||||
return object : CountDownTimer(endMs.toLong(), 1000) {
|
return object : CountDownTimer(endMs.toLong(), 1000) {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user