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

com.yandex.div.dsl.context.CardContext.kt Maven / Gradle / Ivy

Go to download

DivKit is an open source Server-Driven UI (SDUI) framework. SDUI is a an emerging technique that leverage the server to build the user interfaces of their mobile app.

There is a newer version: 30.19.0
Show newest version
package com.yandex.div.dsl.context

import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonUnwrapped
import com.fasterxml.jackson.databind.node.ObjectNode
import com.yandex.div.dsl.Root
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

@Deprecated("Use divkit.dsl framework")
class CardContext {

    @JvmField
    @JsonUnwrapped
    internal var root: Root? = null

    @JvmField
    @JsonIgnore
    internal var asString: String? = null

    @JvmField
    @JsonIgnore
    internal var asNode: ObjectNode? = null
}

@OptIn(ExperimentalContracts::class)
@Deprecated("Use divkit.dsl framework")
fun card(
    initialize: CardContext.() -> Root
): CardContext {
    contract {
        callsInPlace(initialize, InvocationKind.EXACTLY_ONCE)
    }
    val context = CardContext()
    context.root = context.initialize()
    return context
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy