All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.outsidesource.oskitcompose.systemui.KMPAppLifecycleObserver.kt Maven / Gradle / Ivy

package com.outsidesource.oskitcompose.systemui

import kotlinx.coroutines.flow.StateFlow

/**
 * Allows for retrieving/observing the current application state
 * This is primarily for determining if the application is in the foreground or the background
 */
interface IKMPAppLifecycleObserver {
    val lifecycle: StateFlow
    fun init(context: KMPAppLifecycleObserverContext)
}

enum class KMPAppLifecycle {
    // The application is in the background or minimized
    Background,

    // The application is unfocused (desktop) or not ready to receive events (iOS)
    Inactive,

    // The application is in the foreground
    Active,
}

expect object KMPAppLifecycleObserver : IKMPAppLifecycleObserver

expect class KMPAppLifecycleObserverContext




© 2015 - 2025 Weber Informatics LLC | Privacy Policy