Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling moving the app to background #2844

Open
DenBond7 opened this issue Sep 3, 2024 · 0 comments
Open

Improve handling moving the app to background #2844

DenBond7 opened this issue Sep 3, 2024 · 0 comments
Assignees
Milestone

Comments

@DenBond7
Copy link
Collaborator

DenBond7 commented Sep 3, 2024

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)
..........
@DenBond7 DenBond7 added this to the 1.6.0 milestone Sep 3, 2024
@DenBond7 DenBond7 self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant