jvmMain.tech.skot.core.components.SKComponentViewMock.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of viewmodelTests Show documentation
Show all versions of viewmodelTests Show documentation
viewmodelTests description
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