mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
61e4d752c7
71d4d5a24df7378ccb81a8bcbda80a2c7af900f2
110 lines
2.4 KiB
JSON
110 lines
2.4 KiB
JSON
{
|
|
"templates": {
|
|
"block": {
|
|
"type": "container",
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"$text": "text",
|
|
"font_size": 16,
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"margins": {
|
|
"left": 10,
|
|
"right": 10,
|
|
"top": 10,
|
|
"bottom": 10
|
|
}
|
|
}
|
|
],
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#A0FFA0"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "test",
|
|
"variables": [
|
|
{
|
|
"name": "block1_height",
|
|
"type": "integer",
|
|
"value": 0
|
|
}
|
|
],
|
|
"states": [
|
|
{
|
|
"state_id": 0,
|
|
"div": {
|
|
"type": "container",
|
|
"variables": [
|
|
{
|
|
"name": "block2_width",
|
|
"type": "integer",
|
|
"value": 0
|
|
}
|
|
],
|
|
"paddings": {
|
|
"left": 10,
|
|
"top": 10,
|
|
"right": 10,
|
|
"bottom": 10
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "block",
|
|
"text": "width = height x 4\nheight = wrap_content",
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": "@{block1_height * 4}"
|
|
},
|
|
"layout_provider": {
|
|
"height_variable_name": "block1_height"
|
|
}
|
|
},
|
|
{
|
|
"type": "separator",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 10
|
|
}
|
|
},
|
|
{
|
|
"type": "block",
|
|
"text": "height = block1.height",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": "@{block1_height}"
|
|
},
|
|
"layout_provider": {
|
|
"width_variable_name": "block2_width"
|
|
}
|
|
},
|
|
{
|
|
"type": "separator",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 10
|
|
}
|
|
},
|
|
{
|
|
"type": "block",
|
|
"text": "width = block2.width",
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": "@{block2_width}"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|