-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Milestone
Description
Need to improve handling moving the app to background. It will improve showing notifications about new messages.
class AppForegroundedObserver : DefaultLifecycleObserver {
val isAppForegrounded: Boolean
get() {
return isAppForegroundedInternal
}
private var isAppForegroundedInternal = false
override fun onStart(owner: LifecycleOwner) {
isAppForegroundedInternal = false
}
override fun onStop(owner: LifecycleOwner) {
isAppForegroundedInternal = true
}
}
class FlowCryptApplication : Application(), Configuration.Provider {
val appForegroundedObserver = AppForegroundedObserver()
.........
override fun onCreate() {
super.onCreate()
ProcessLifecycleOwner.get().lifecycle.addObserver(appForegroundedObserver)
..........