mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-02-12 18:00:51 +01:00
commit
149c072713
@ -15,6 +15,7 @@ import com.simplemobiletools.clock.R
|
||||
import com.simplemobiletools.clock.databinding.ActivityReminderBinding
|
||||
import com.simplemobiletools.clock.extensions.*
|
||||
import com.simplemobiletools.clock.helpers.ALARM_ID
|
||||
import com.simplemobiletools.clock.helpers.ALARM_NOTIF_ID
|
||||
import com.simplemobiletools.clock.helpers.getPassedSeconds
|
||||
import com.simplemobiletools.clock.models.Alarm
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
@ -40,6 +41,7 @@ class ReminderActivity : SimpleActivity() {
|
||||
private var initialAlarmVolume: Int? = null
|
||||
private var dragDownX = 0f
|
||||
private val binding: ActivityReminderBinding by viewBinding(ActivityReminderBinding::inflate)
|
||||
private var finished = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
isMaterialActivity = true
|
||||
@ -239,7 +241,12 @@ class ReminderActivity : SimpleActivity() {
|
||||
maxReminderDurationHandler.removeCallbacksAndMessages(null)
|
||||
swipeGuideFadeHandler.removeCallbacksAndMessages(null)
|
||||
vibrationHandler.removeCallbacksAndMessages(null)
|
||||
destroyEffects()
|
||||
if (!finished) {
|
||||
finishActivity()
|
||||
notificationManager.cancel(ALARM_NOTIF_ID)
|
||||
} else {
|
||||
destroyEffects()
|
||||
}
|
||||
}
|
||||
|
||||
private fun destroyEffects() {
|
||||
@ -291,6 +298,7 @@ class ReminderActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
finished = true
|
||||
destroyEffects()
|
||||
finish()
|
||||
overridePendingTransition(0, 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user