mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-02-20 22:00:45 +01:00
hide timer notification at Reset or play/pause toggle too
This commit is contained in:
parent
256c686a03
commit
a542775a84
@ -141,6 +141,7 @@ class TimerFragment : Fragment() {
|
||||
private fun togglePlayPause() {
|
||||
isRunning = !isRunning
|
||||
updateIcons()
|
||||
hideTimerNotification()
|
||||
|
||||
if (isRunning) {
|
||||
updateHandler.post(updateRunnable)
|
||||
@ -165,6 +166,7 @@ class TimerFragment : Fragment() {
|
||||
currentTicks = 0
|
||||
totalTicks = 0
|
||||
initialSecs = context!!.config.timerSeconds
|
||||
hideTimerNotification()
|
||||
updateDisplayedText()
|
||||
updateIcons()
|
||||
view.timer_reset.beGone()
|
||||
@ -189,7 +191,7 @@ class TimerFragment : Fragment() {
|
||||
notificationManager.notify(TIMER_NOTIF_ID, notification)
|
||||
|
||||
Handler().postDelayed({
|
||||
context?.hideNotification(TIMER_NOTIF_ID)
|
||||
hideTimerNotification()
|
||||
}, context?.config!!.timerMaxReminderSecs * 1000L)
|
||||
}
|
||||
return true
|
||||
@ -245,6 +247,10 @@ class TimerFragment : Fragment() {
|
||||
return PendingIntent.getActivity(context, TIMER_NOTIF_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
}
|
||||
|
||||
private fun hideTimerNotification() {
|
||||
context?.hideNotification(TIMER_NOTIF_ID)
|
||||
}
|
||||
|
||||
private val updateRunnable = object : Runnable {
|
||||
override fun run() {
|
||||
if (isRunning) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user