mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-01-20 21:01:23 +01:00
Merge pull request #289 from KryptKode/fix/timer-max-reminder
fix timer max reminder duration
This commit is contained in:
commit
fe08a533a8
@ -5,15 +5,15 @@ import android.app.NotificationManager
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.CountDownTimer
|
import android.os.CountDownTimer
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.LifecycleObserver
|
import androidx.lifecycle.LifecycleObserver
|
||||||
import androidx.lifecycle.OnLifecycleEvent
|
import androidx.lifecycle.OnLifecycleEvent
|
||||||
import androidx.lifecycle.ProcessLifecycleOwner
|
import androidx.lifecycle.ProcessLifecycleOwner
|
||||||
import com.facebook.stetho.Stetho
|
import com.facebook.stetho.Stetho
|
||||||
import com.simplemobiletools.clock.extensions.getOpenTimerTabIntent
|
import com.simplemobiletools.clock.extensions.*
|
||||||
import com.simplemobiletools.clock.extensions.getTimerNotification
|
|
||||||
import com.simplemobiletools.clock.extensions.timerHelper
|
|
||||||
import com.simplemobiletools.clock.models.TimerEvent
|
import com.simplemobiletools.clock.models.TimerEvent
|
||||||
import com.simplemobiletools.clock.models.TimerState
|
import com.simplemobiletools.clock.models.TimerState
|
||||||
import com.simplemobiletools.clock.services.TimerStopService
|
import com.simplemobiletools.clock.services.TimerStopService
|
||||||
@ -104,6 +104,9 @@ class App : Application(), LifecycleObserver {
|
|||||||
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
notificationManager.notify(event.timerId, notification)
|
notificationManager.notify(event.timerId, notification)
|
||||||
updateTimerState(event.timerId, TimerState.Finished)
|
updateTimerState(event.timerId, TimerState.Finished)
|
||||||
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
hideNotification(event.timerId)
|
||||||
|
}, config.timerMaxReminderSecs * 1000L)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user