Files
divkit/test_data/regression_test_data/double_slider.json
T
2022-09-06 10:43:11 +03:00

347 lines
8.8 KiB
JSON

{
"templates": {
"nps_button": {
"type": "text",
"paddings": {
"top": 12,
"bottom": 12,
"left": 48,
"right": 48
},
"text_alignment_horizontal": "center",
"text_alignment_vertical": "center",
"font_size": 24,
"height": {
"type": "wrap_content"
},
"width": {
"type": "match_parent"
},
"border": {
"corner_radius": 16,
"stroke": {
"color": "#50000000",
"width": 1
}
}
},
"counter": {
"type": "state",
"margins": {
"top": 16,
"left": 12,
"right": 12
},
"states": [
{
"state_id": "6",
"div": {
"type": "nps_button",
"text": "🤔 Not sure"
}
},
{
"state_id": "1",
"div": {
"type": "nps_button",
"text": "😔 This is bad"
}
},
{
"state_id": "2",
"div": {
"type": "nps_button",
"text": "😔 This is bad"
}
},
{
"state_id": "3",
"div": {
"type": "nps_button",
"text": "😔 This is bad"
}
},
{
"state_id": "4",
"div": {
"type": "nps_button",
"text": "🤔 Not sure"
}
},
{
"state_id": "5",
"div": {
"type": "nps_button",
"text": "🤔 Not sure"
}
},
{
"state_id": "7",
"div": {
"type": "nps_button",
"text": "😐 You can do better"
}
},
{
"state_id": "8",
"div": {
"type": "nps_button",
"text": "🙂 Good"
}
},
{
"state_id": "9",
"div": {
"type": "nps_button",
"text": "😁 Excellent"
}
},
{
"state_id": "10",
"div": {
"type": "nps_button",
"text": "😍😍😍"
}
}
]
}
},
"card": {
"log_id": "test",
"variables": [
{
"name": "my_thumb_value",
"type": "integer",
"value": 6
},
{
"name": "my_thumb_secondary_value",
"type": "integer",
"value": 10
}
],
"variable_triggers": [
{
"condition": "@{my_thumb_value >= 0}",
"mode": "on_variable",
"actions": [
{
"log_id": "ya_action",
"url": "div-action://set_state?state_id=0/counter/@{my_thumb_value}"
}
]
}
],
"states": [
{
"state_id": 0,
"div": {
"type": "container",
"margins": {
"top": 8,
"bottom": 8,
"left": 8,
"right": 8
},
"items": [
{
"type": "text",
"text": "Scroll up to find slider",
"margins": {
"top": 256,
"bottom": 256,
"left": 12,
"right": 12
},
"font_size": 24
},
{
"type": "text",
"text": "Will you recommend Yandex to your friends and family?",
"margins": {
"top": 8,
"bottom": 8,
"left": 12,
"right": 12
},
"font_size": 24
},
{
"type": "container",
"orientation": "overlap",
"margins": {
"top": 8,
"bottom": 8,
"left": 12,
"right": 12
},
"items": [
{
"type": "text",
"text": "always",
"item_width": {
"type": "match_parent"
},
"text_alignment_horizontal": "right",
"text_alignment_vertical": "center",
"text_color": "#a0000000"
},
{
"type": "text",
"text": "never",
"text_color": "#a0000000"
}
]
},
{
"type": "slider",
"width": {
"type": "match_parent"
},
"max_value": 10,
"min_value": 3,
"thumb_value_variable": "my_thumb_value",
"border": {
"corner_radius": 16,
"stroke": {
"color": "#50000000",
"width": 1
}
},
"thumb_style": {
"type": "shape_drawable",
"color": "#ff0000",
"stroke": {
"color": "#ffffff",
"width": 3
},
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 32
},
"item_width": {
"type": "fixed",
"value": 32
},
"corner_radius": {
"type": "fixed",
"value": 100
}
}
},
"thumb_secondary_style": {
"type": "shape_drawable",
"color": "#ff0000",
"stroke": {
"color": "#ffffff",
"width": 3
},
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 32
},
"item_width": {
"type": "fixed",
"value": 32
},
"corner_radius": {
"type": "fixed",
"value": 100
}
}
},
"thumb_secondary_value_variable": "my_thumb_secondary_value",
"tick_mark_active_style": {
"type": "shape_drawable",
"color": "#ff0000",
"stroke": {
"color": "#ffffff",
"width": 2
},
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 8
},
"item_width": {
"type": "fixed",
"value": 8
},
"corner_radius": {
"type": "fixed",
"value": 5
}
}
},
"tick_mark_inactive_style": {
"type": "shape_drawable",
"color": "#20000000",
"stroke": {
"color": "#ffffff",
"width": 2
},
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 8
},
"item_width": {
"type": "fixed",
"value": 8
},
"corner_radius": {
"type": "fixed",
"value": 5
}
}
},
"track_active_style": {
"type": "shape_drawable",
"color": "#ff0000",
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 6
}
}
},
"track_inactive_style": {
"type": "shape_drawable",
"color": "#20000000",
"shape": {
"type": "rounded_rectangle",
"item_height": {
"type": "fixed",
"value": 6
}
}
},
"thumb_text_style": {
"font_size": 16,
"text_color": "#00ff00",
"font_weight": "bold"
},
"thumb_secondary_text_style": {
"font_size": 16,
"text_color": "#00ff00",
"font_weight": "bold"
}
},
{
"type": "counter",
"div_id": "counter"
}
]
}
}
]
}
}