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

com.yandex.div.dsl.model.DivAnimation.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.28.0
Show newest version
// Generated code. Do not modify.

package com.yandex.div.dsl.model

import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*

class DivAnimation internal constructor(
    @JsonIgnore val duration: Property?,
    @JsonIgnore val endValue: Property?,
    @JsonIgnore val interpolator: Property?,
    @JsonIgnore val items: Property>?,
    @JsonIgnore val name: Property?,
    @JsonIgnore val repeat: Property?,
    @JsonIgnore val startDelay: Property?,
    @JsonIgnore val startValue: Property?,
) {

    @JsonAnyGetter
    internal fun properties(): Map {
        return propertyMapOf(
            "duration" to duration,
            "end_value" to endValue,
            "interpolator" to interpolator,
            "items" to items,
            "name" to name,
            "repeat" to repeat,
            "start_delay" to startDelay,
            "start_value" to startValue,
        )
    }

    enum class Name(@JsonValue val value: String) {
        FADE("fade"),
        TRANSLATE("translate"),
        SCALE("scale"),
        NATIVE("native"),
        SET("set"),
        NO_ANIMATION("no_animation"),
    }
}

fun  TemplateContext.divAnimation(): LiteralProperty {
    return value(DivAnimation(
        duration = null,
        endValue = null,
        interpolator = null,
        items = null,
        name = null,
        repeat = null,
        startDelay = null,
        startValue = null,
    ))
}

fun  TemplateContext.divAnimation(
    name: Property? = null,
    duration: Property? = null,
    endValue: Property? = null,
    interpolator: Property? = null,
    items: Property>? = null,
    repeat: Property? = null,
    startDelay: Property? = null,
    startValue: Property? = null,
): LiteralProperty {
    return value(DivAnimation(
        duration = duration,
        endValue = endValue,
        interpolator = interpolator,
        items = items,
        name = name,
        repeat = repeat,
        startDelay = startDelay,
        startValue = startValue,
    ))
}

fun  TemplateContext.divAnimation(
    name: DivAnimation.Name? = null,
    duration: Int? = null,
    endValue: Double? = null,
    interpolator: DivAnimationInterpolator? = null,
    items: List? = null,
    repeat: DivCount? = null,
    startDelay: Int? = null,
    startValue: Double? = null,
): LiteralProperty {
    return value(DivAnimation(
        duration = optionalValue(duration),
        endValue = optionalValue(endValue),
        interpolator = optionalValue(interpolator),
        items = optionalValue(items),
        name = optionalValue(name),
        repeat = optionalValue(repeat),
        startDelay = optionalValue(startDelay),
        startValue = optionalValue(startValue),
    ))
}

fun CardContext.divAnimation(
    name: ValueProperty,
    duration: ValueProperty? = null,
    endValue: ValueProperty? = null,
    interpolator: ValueProperty? = null,
    items: ValueProperty>? = null,
    repeat: ValueProperty? = null,
    startDelay: ValueProperty? = null,
    startValue: ValueProperty? = null,
): DivAnimation {
    return DivAnimation(
        duration = duration,
        endValue = endValue,
        interpolator = interpolator,
        items = items,
        name = name,
        repeat = repeat,
        startDelay = startDelay,
        startValue = startValue,
    )
}

fun CardContext.divAnimation(
    name: DivAnimation.Name,
    duration: Int? = null,
    endValue: Double? = null,
    interpolator: DivAnimationInterpolator? = null,
    items: List? = null,
    repeat: DivCount? = null,
    startDelay: Int? = null,
    startValue: Double? = null,
): DivAnimation {
    return DivAnimation(
        duration = optionalValue(duration),
        endValue = optionalValue(endValue),
        interpolator = optionalValue(interpolator),
        items = optionalValue(items),
        name = value(name),
        repeat = optionalValue(repeat),
        startDelay = optionalValue(startDelay),
        startValue = optionalValue(startValue),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy