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

androidMain.tech.skot.view.live.SKLifecycle.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.view.live

import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver

class SKLifecycle(private val parent: Lifecycle) : Lifecycle() {
    override fun addObserver(observer: LifecycleObserver) {
        parent.addObserver(observer)
    }

    override fun removeObserver(observer: LifecycleObserver) {
        parent.removeObserver(observer)
    }

    var recycled: Boolean = false

    override fun getCurrentState(): State {
        return if (recycled) {
            State.DESTROYED
        } else {
            parent.currentState
        }
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy