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

divkit.dsl.DefaultIndicatorItemPlacement.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
@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

/**
 * Element size adjusts to a parent element.
 * 
 * Can be created using the method [defaultIndicatorItemPlacement].
 * 
 * Required parameters: `type`.
 */
@Generated
class DefaultIndicatorItemPlacement internal constructor(
    @JsonIgnore
    val properties: Properties,
) : IndicatorItemPlacement {
    @JsonAnyGetter
    internal fun getJsonProperties(): Map = properties.mergeWith(
        mapOf("type" to "default")
    )

    operator fun plus(additive: Properties): DefaultIndicatorItemPlacement = DefaultIndicatorItemPlacement(
        Properties(
            spaceBetweenCenters = additive.spaceBetweenCenters ?: properties.spaceBetweenCenters,
        )
    )

    class Properties internal constructor(
        /**
         * Spacing between indicator centers.
         * Default value: `{"type": "fixed","value":15}`.
         */
        val spaceBetweenCenters: Property?,
    ) {
        internal fun mergeWith(properties: Map): Map {
            val result = mutableMapOf()
            result.putAll(properties)
            result.tryPutProperty("space_between_centers", spaceBetweenCenters)
            return result
        }
    }
}

/**
 * @param spaceBetweenCenters Spacing between indicator centers.
 */
@Generated
fun DivScope.defaultIndicatorItemPlacement(
    `use named arguments`: Guard = Guard.instance,
    spaceBetweenCenters: FixedSize? = null,
): DefaultIndicatorItemPlacement = DefaultIndicatorItemPlacement(
    DefaultIndicatorItemPlacement.Properties(
        spaceBetweenCenters = valueOrNull(spaceBetweenCenters),
    )
)

/**
 * @param spaceBetweenCenters Spacing between indicator centers.
 */
@Generated
fun DivScope.defaultIndicatorItemPlacementProps(
    `use named arguments`: Guard = Guard.instance,
    spaceBetweenCenters: FixedSize? = null,
) = DefaultIndicatorItemPlacement.Properties(
    spaceBetweenCenters = valueOrNull(spaceBetweenCenters),
)

/**
 * @param spaceBetweenCenters Spacing between indicator centers.
 */
@Generated
fun TemplateScope.defaultIndicatorItemPlacementRefs(
    `use named arguments`: Guard = Guard.instance,
    spaceBetweenCenters: ReferenceProperty? = null,
) = DefaultIndicatorItemPlacement.Properties(
    spaceBetweenCenters = spaceBetweenCenters,
)

/**
 * @param spaceBetweenCenters Spacing between indicator centers.
 */
@Generated
fun DefaultIndicatorItemPlacement.override(
    `use named arguments`: Guard = Guard.instance,
    spaceBetweenCenters: FixedSize? = null,
): DefaultIndicatorItemPlacement = DefaultIndicatorItemPlacement(
    DefaultIndicatorItemPlacement.Properties(
        spaceBetweenCenters = valueOrNull(spaceBetweenCenters) ?: properties.spaceBetweenCenters,
    )
)

/**
 * @param spaceBetweenCenters Spacing between indicator centers.
 */
@Generated
fun DefaultIndicatorItemPlacement.defer(
    `use named arguments`: Guard = Guard.instance,
    spaceBetweenCenters: ReferenceProperty? = null,
): DefaultIndicatorItemPlacement = DefaultIndicatorItemPlacement(
    DefaultIndicatorItemPlacement.Properties(
        spaceBetweenCenters = spaceBetweenCenters ?: properties.spaceBetweenCenters,
    )
)

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy