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

androidMain.tech.skot.core.components.ScreensManager.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.core.components

import tech.skot.view.SKPermissionsRequestResultAndroid
import tech.skot.view.live.SKMessage


object ScreensManager {

    private var counter: Long = 0
    private val instances: MutableMap> = mutableMapOf()

    fun getInstance(key: Long): SKScreenViewProxy<*>? = instances.get(key)

    fun addScreen(screen: SKScreenViewProxy<*>): Long {
        val key = counter++
        instances[key] = screen
        return key
    }

    fun removeScreen(screen: SKScreenViewProxy<*>) {
        instances.remove(screen.key)
    }


    val backPressed = SKMessage(true)
    val permissionsResults = SKMessage()

    const val SK_EXTRA_VIEW_KEY = "SK_EXTRA_VIEW_KEY"
    const val SK_ARGUMENT_VIEW_KEY = "SK_ARGUMENT_VIEW_KEY"
    const val SK_ARGUMENT_DIALOG_STYLE = "SK_ARGUMENT_DIALOG_STYLE"
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy