mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-04-15 18:57:22 +02: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() {
|
private fun togglePlayPause() {
|
||||||
isRunning = !isRunning
|
isRunning = !isRunning
|
||||||
updateIcons()
|
updateIcons()
|
||||||
|
hideTimerNotification()
|
||||||
|
|
||||||
if (isRunning) {
|
if (isRunning) {
|
||||||
updateHandler.post(updateRunnable)
|
updateHandler.post(updateRunnable)
|
||||||
@ -165,6 +166,7 @@ class TimerFragment : Fragment() {
|
|||||||
currentTicks = 0
|
currentTicks = 0
|
||||||
totalTicks = 0
|
totalTicks = 0
|
||||||
initialSecs = context!!.config.timerSeconds
|
initialSecs = context!!.config.timerSeconds
|
||||||
|
hideTimerNotification()
|
||||||
updateDisplayedText()
|
updateDisplayedText()
|
||||||
updateIcons()
|
updateIcons()
|
||||||
view.timer_reset.beGone()
|
view.timer_reset.beGone()
|
||||||
@ -189,7 +191,7 @@ class TimerFragment : Fragment() {
|
|||||||
notificationManager.notify(TIMER_NOTIF_ID, notification)
|
notificationManager.notify(TIMER_NOTIF_ID, notification)
|
||||||
|
|
||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
context?.hideNotification(TIMER_NOTIF_ID)
|
hideTimerNotification()
|
||||||
}, context?.config!!.timerMaxReminderSecs * 1000L)
|
}, context?.config!!.timerMaxReminderSecs * 1000L)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@ -245,6 +247,10 @@ class TimerFragment : Fragment() {
|
|||||||
return PendingIntent.getActivity(context, TIMER_NOTIF_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
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 {
|
private val updateRunnable = object : Runnable {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (isRunning) {
|
if (isRunning) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user