mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
properly schedule the next alarm at cancelling one
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
package com.simplemobiletools.clock.activities
|
package com.simplemobiletools.clock.activities
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.NotificationManager
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
@ -126,7 +125,7 @@ class ReminderActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isOreoPlus()) {
|
if (isOreoPlus()) {
|
||||||
getSystemService(NotificationManager::class.java).cancelAll()
|
notificationManager.cancelAll()
|
||||||
}
|
}
|
||||||
} else if (reminder_draggable.x <= minDragX + 50f) {
|
} else if (reminder_draggable.x <= minDragX + 50f) {
|
||||||
if (!didVibrate) {
|
if (!didVibrate) {
|
||||||
@ -136,7 +135,7 @@ class ReminderActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isOreoPlus()) {
|
if (isOreoPlus()) {
|
||||||
getSystemService(NotificationManager::class.java).cancelAll()
|
notificationManager.cancelAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,6 +221,10 @@ class ReminderActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun finishActivity() {
|
private fun finishActivity() {
|
||||||
|
if (alarm != null) {
|
||||||
|
scheduleNextAlarm(alarm!!, false)
|
||||||
|
}
|
||||||
|
|
||||||
destroyPlayer()
|
destroyPlayer()
|
||||||
finish()
|
finish()
|
||||||
overridePendingTransition(0, 0)
|
overridePendingTransition(0, 0)
|
||||||
|
@ -10,7 +10,6 @@ import android.media.AudioAttributes
|
|||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.media.AudioManager.STREAM_ALARM
|
import android.media.AudioManager.STREAM_ALARM
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.text.style.RelativeSizeSpan
|
import android.text.style.RelativeSizeSpan
|
||||||
|
Reference in New Issue
Block a user