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

jvmMain.tech.skot.core.components.SKComponentViewMock.kt Maven / Gradle / Ivy

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

import tech.skot.core.view.SKPermission
import tech.skot.core.view.Style

abstract class SKComponentViewMock : SKComponentVC {
    override var style: Style? = null


    var closeKeyBoardCounter = 0
    override fun closeKeyboard() {
        closeKeyBoardCounter++
    }

    val displayErrorMessages: MutableList = mutableListOf()
    override fun displayErrorMessage(message: String) {
        displayErrorMessages.add(message)
    }

    var permissionsOk = emptyList()
    override fun requestPermissions(
        permissions: List,
        onResult: (permissionsOk: List) -> Unit
    ) {
        onResult(permissions.filter { permissionsOk.contains(it) })
    }

    override fun hasPermission(vararg permission: SKPermission): Boolean {
        return permission.all {
            permissionsOk.contains(it)
        }
    }

    var removed = false
    override fun onRemove() {
        removed = true
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy