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

divkit.dsl.ActionAnimatorStart.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.32.0
Show newest version
@file:Suppress(
    "unused",
    "UNUSED_PARAMETER",
)

package divkit.dsl

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonValue
import divkit.dsl.annotation.*
import divkit.dsl.core.*
import divkit.dsl.scope.*
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Starts specified animator
 * 
 * Can be created using the method [actionAnimatorStart].
 * 
 * Required parameters: `type, animator_id`.
 */
@Generated
class ActionAnimatorStart internal constructor(
    @JsonIgnore
    val properties: Properties,
) : ActionTyped {
    @JsonAnyGetter
    internal fun getJsonProperties(): Map = properties.mergeWith(
        mapOf("type" to "animator_start")
    )

    operator fun plus(additive: Properties): ActionAnimatorStart = ActionAnimatorStart(
        Properties(
            animatorId = additive.animatorId ?: properties.animatorId,
            direction = additive.direction ?: properties.direction,
            duration = additive.duration ?: properties.duration,
            endValue = additive.endValue ?: properties.endValue,
            interpolator = additive.interpolator ?: properties.interpolator,
            repeatCount = additive.repeatCount ?: properties.repeatCount,
            startDelay = additive.startDelay ?: properties.startDelay,
            startValue = additive.startValue ?: properties.startValue,
        )
    )

    class Properties internal constructor(
        /**
         * The identifier of the animator being started.
         */
        val animatorId: Property?,
        /**
         * Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
         */
        val direction: Property?,
        /**
         * Animation duration in milliseconds.
         */
        val duration: Property?,
        /**
         * Overrides value that will be set at the end of animation.
         */
        val endValue: Property?,
        /**
         * Interpolation function.
         */
        val interpolator: Property?,
        /**
         * The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
         */
        val repeatCount: Property?,
        /**
         * Animation start delay in milliseconds.
         */
        val startDelay: Property?,
        /**
         * Overrides value that will be set at the start of animation.
         */
        val startValue: Property?,
    ) {
        internal fun mergeWith(properties: Map): Map {
            val result = mutableMapOf()
            result.putAll(properties)
            result.tryPutProperty("animator_id", animatorId)
            result.tryPutProperty("direction", direction)
            result.tryPutProperty("duration", duration)
            result.tryPutProperty("end_value", endValue)
            result.tryPutProperty("interpolator", interpolator)
            result.tryPutProperty("repeat_count", repeatCount)
            result.tryPutProperty("start_delay", startDelay)
            result.tryPutProperty("start_value", startValue)
            return result
        }
    }
}

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param endValue Overrides value that will be set at the end of animation.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 * @param startValue Overrides value that will be set at the start of animation.
 */
@Generated
fun DivScope.actionAnimatorStart(
    `use named arguments`: Guard = Guard.instance,
    animatorId: String? = null,
    direction: AnimationDirection? = null,
    duration: Long? = null,
    endValue: TypedValue? = null,
    interpolator: AnimationInterpolator? = null,
    repeatCount: Int? = null,
    startDelay: Int? = null,
    startValue: TypedValue? = null,
): ActionAnimatorStart = ActionAnimatorStart(
    ActionAnimatorStart.Properties(
        animatorId = valueOrNull(animatorId),
        direction = valueOrNull(direction),
        duration = valueOrNull(duration),
        endValue = valueOrNull(endValue),
        interpolator = valueOrNull(interpolator),
        repeatCount = valueOrNull(repeatCount),
        startDelay = valueOrNull(startDelay),
        startValue = valueOrNull(startValue),
    )
)

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param endValue Overrides value that will be set at the end of animation.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 * @param startValue Overrides value that will be set at the start of animation.
 */
@Generated
fun DivScope.actionAnimatorStartProps(
    `use named arguments`: Guard = Guard.instance,
    animatorId: String? = null,
    direction: AnimationDirection? = null,
    duration: Long? = null,
    endValue: TypedValue? = null,
    interpolator: AnimationInterpolator? = null,
    repeatCount: Int? = null,
    startDelay: Int? = null,
    startValue: TypedValue? = null,
) = ActionAnimatorStart.Properties(
    animatorId = valueOrNull(animatorId),
    direction = valueOrNull(direction),
    duration = valueOrNull(duration),
    endValue = valueOrNull(endValue),
    interpolator = valueOrNull(interpolator),
    repeatCount = valueOrNull(repeatCount),
    startDelay = valueOrNull(startDelay),
    startValue = valueOrNull(startValue),
)

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param endValue Overrides value that will be set at the end of animation.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 * @param startValue Overrides value that will be set at the start of animation.
 */
@Generated
fun TemplateScope.actionAnimatorStartRefs(
    `use named arguments`: Guard = Guard.instance,
    animatorId: ReferenceProperty? = null,
    direction: ReferenceProperty? = null,
    duration: ReferenceProperty? = null,
    endValue: ReferenceProperty? = null,
    interpolator: ReferenceProperty? = null,
    repeatCount: ReferenceProperty? = null,
    startDelay: ReferenceProperty? = null,
    startValue: ReferenceProperty? = null,
) = ActionAnimatorStart.Properties(
    animatorId = animatorId,
    direction = direction,
    duration = duration,
    endValue = endValue,
    interpolator = interpolator,
    repeatCount = repeatCount,
    startDelay = startDelay,
    startValue = startValue,
)

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param endValue Overrides value that will be set at the end of animation.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 * @param startValue Overrides value that will be set at the start of animation.
 */
@Generated
fun ActionAnimatorStart.override(
    `use named arguments`: Guard = Guard.instance,
    animatorId: String? = null,
    direction: AnimationDirection? = null,
    duration: Long? = null,
    endValue: TypedValue? = null,
    interpolator: AnimationInterpolator? = null,
    repeatCount: Int? = null,
    startDelay: Int? = null,
    startValue: TypedValue? = null,
): ActionAnimatorStart = ActionAnimatorStart(
    ActionAnimatorStart.Properties(
        animatorId = valueOrNull(animatorId) ?: properties.animatorId,
        direction = valueOrNull(direction) ?: properties.direction,
        duration = valueOrNull(duration) ?: properties.duration,
        endValue = valueOrNull(endValue) ?: properties.endValue,
        interpolator = valueOrNull(interpolator) ?: properties.interpolator,
        repeatCount = valueOrNull(repeatCount) ?: properties.repeatCount,
        startDelay = valueOrNull(startDelay) ?: properties.startDelay,
        startValue = valueOrNull(startValue) ?: properties.startValue,
    )
)

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param endValue Overrides value that will be set at the end of animation.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 * @param startValue Overrides value that will be set at the start of animation.
 */
@Generated
fun ActionAnimatorStart.defer(
    `use named arguments`: Guard = Guard.instance,
    animatorId: ReferenceProperty? = null,
    direction: ReferenceProperty? = null,
    duration: ReferenceProperty? = null,
    endValue: ReferenceProperty? = null,
    interpolator: ReferenceProperty? = null,
    repeatCount: ReferenceProperty? = null,
    startDelay: ReferenceProperty? = null,
    startValue: ReferenceProperty? = null,
): ActionAnimatorStart = ActionAnimatorStart(
    ActionAnimatorStart.Properties(
        animatorId = animatorId ?: properties.animatorId,
        direction = direction ?: properties.direction,
        duration = duration ?: properties.duration,
        endValue = endValue ?: properties.endValue,
        interpolator = interpolator ?: properties.interpolator,
        repeatCount = repeatCount ?: properties.repeatCount,
        startDelay = startDelay ?: properties.startDelay,
        startValue = startValue ?: properties.startValue,
    )
)

/**
 * @param animatorId The identifier of the animator being started.
 * @param direction Animation direction. This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
 * @param duration Animation duration in milliseconds.
 * @param interpolator Interpolation function.
 * @param repeatCount The number of times the animation will repeat before it finishes. `0` enables infinite repeats.
 * @param startDelay Animation start delay in milliseconds.
 */
@Generated
fun ActionAnimatorStart.evaluate(
    `use named arguments`: Guard = Guard.instance,
    animatorId: ExpressionProperty? = null,
    direction: ExpressionProperty? = null,
    duration: ExpressionProperty? = null,
    interpolator: ExpressionProperty? = null,
    repeatCount: ExpressionProperty? = null,
    startDelay: ExpressionProperty? = null,
): ActionAnimatorStart = ActionAnimatorStart(
    ActionAnimatorStart.Properties(
        animatorId = animatorId ?: properties.animatorId,
        direction = direction ?: properties.direction,
        duration = duration ?: properties.duration,
        endValue = properties.endValue,
        interpolator = interpolator ?: properties.interpolator,
        repeatCount = repeatCount ?: properties.repeatCount,
        startDelay = startDelay ?: properties.startDelay,
        startValue = properties.startValue,
    )
)

@Generated
fun ActionAnimatorStart.asList() = listOf(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy