Use state_id_variable value instead of cached state id

commit_hash:40c91b0c9b3debc7077c775e078017f1d8471b65
This commit is contained in:
grechka62
2026-03-23 22:13:52 +03:00
parent af625f5308
commit 97c06317da
56 changed files with 155 additions and 82 deletions
+45
View File
@@ -2255,6 +2255,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API24_HDPI_540x1200/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -3717,6 +3722,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -5361,6 +5371,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API26_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -7005,6 +7020,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -8649,6 +8669,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API28_XHDPI_720x1600/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -10293,6 +10318,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -11937,6 +11967,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API30_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -13581,6 +13616,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewPixelCopy/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -15225,6 +15265,11 @@
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/specific-properties/step3.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-action-synchronization/step2.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-change-variable-synchronization/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step0.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step1.png",
"client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png":"divkit/public/client/android/divkit-demo-app/src/screenshotTest/screenshots/API32_XXHDPI_1080x2400/viewRender/com.yandex.div.Div2InteractiveScreenshotTest/div-gallery/state-preservation-basic/step2.png",
@@ -6,14 +6,14 @@ import com.yandex.div.core.expression.ExpressionResolverImpl
import com.yandex.div.core.expression.ExpressionsRuntime
import com.yandex.div.core.state.DivPathUtils.getIds
import com.yandex.div.core.state.DivPathUtils.getItemIds
import com.yandex.div.core.state.DivPathUtils.statePath
import com.yandex.div.core.state.DivStateManager
import com.yandex.div.core.state.DivStatePath
import com.yandex.div.core.state.TabsStateCache
import com.yandex.div.core.state.TemporaryDivStateCache
import com.yandex.div.core.util.toIntSafely
import com.yandex.div.core.view2.Div2View
import com.yandex.div.internal.core.build
import com.yandex.div.json.expressions.ExpressionResolver
import com.yandex.div.state.DivStateCache
import com.yandex.div2.Div
import com.yandex.div2.DivCollectionItemBuilder
import com.yandex.div2.DivState
@@ -23,8 +23,7 @@ import javax.inject.Inject
@DivScope
@Mockable
internal class DivRuntimeVisitor @Inject constructor(
private val divStateCache: DivStateCache,
private val temporaryStateCache: TemporaryDivStateCache,
private val stateManager: DivStateManager,
private val tabsCache: TabsStateCache,
) {
@@ -147,16 +146,14 @@ internal class DivRuntimeVisitor @Inject constructor(
path: DivStatePath,
resolver: ExpressionResolverImpl,
): String? {
val statePath = "${path.statesString}/${path.lastDivId}"
val cardId = divView.divTag.id
return temporaryStateCache.getState(cardId, statePath)
?: divStateCache.getState(cardId, statePath)
?: div.stateIdVariable?.let { resolver.getVariable(it)?.getValue()?.toString() }
return div.stateIdVariable?.let { resolver.getVariable(it)?.getValue()?.toString() }
?: stateManager.getState(divView.cardId, path.statePath)
?: div.defaultStateId?.evaluate(resolver)
?: div.states.firstOrNull()?.stateId
}
private val Div2View.cardId get() = divTag.id
private fun visitState(
div: Div.State,
divView: Div2View,
@@ -197,7 +194,7 @@ internal class DivRuntimeVisitor @Inject constructor(
path: DivStatePath,
runtime: ExpressionsRuntime,
) {
val activeTab = tabsCache.getSelectedTab(divView.dataTag.id, path.fullPath)
val activeTab = tabsCache.getSelectedTab(divView.cardId, path.fullPath)
?: div.selectedTab.evaluate(runtime.expressionResolver).toIntSafely()
val ids = div.items.getIds({ this.div })
@@ -182,6 +182,8 @@ internal object DivPathUtils {
}
fun Div.getId() = value().run { if (this is DivState) getId() else id }
val DivStatePath.statePath get() = "$statesString/$lastDivId"
}
internal class StateConflictException(message: String, cause: Throwable? = null) : Exception(message, cause)
@@ -4,9 +4,21 @@ import androidx.annotation.AnyThread
import androidx.collection.ArrayMap
import com.yandex.div.DivDataTag
import com.yandex.div.core.dagger.DivScope
import com.yandex.div.core.expression.asImpl
import com.yandex.div.core.state.DivPathUtils.statePath
import com.yandex.div.core.view2.BindingContext
import com.yandex.div.data.Variable
import com.yandex.div.internal.Assert
import com.yandex.div.internal.core.DivTreeVisitor
import com.yandex.div.state.DivStateCache
import com.yandex.div2.Div
import com.yandex.div2.DivData
import java.lang.ref.WeakReference
import javax.inject.Inject
private typealias CardVariables = MutableMap<String, StateVariableHolder>
private typealias VariableUpdater = (String) -> Unit
/**
* Manipulates application's div data state change and retrieval.
*/
@@ -16,7 +28,14 @@ internal class DivStateManager @Inject constructor(
private val cache: DivStateCache,
private val temporaryCache: TemporaryDivStateCache
) {
private val states = ArrayMap<DivDataTag, DivViewState>()
private val variables = mutableMapOf<String, CardVariables>()
fun collectStateVariables(data: DivData, context: BindingContext) {
val cardVariables = variables.getOrPut(context.divView.dataTag.id) { mutableMapOf() }
StateVariableCollector(cardVariables).collectStateVariables(data, context)
}
fun getState(tag: DivDataTag): DivViewState? = synchronized(states) {
var state = states[tag]
@@ -27,18 +46,18 @@ internal class DivStateManager @Inject constructor(
return state
}
fun getState(cardId: String, statePath: String): String? =
temporaryCache.getState(cardId, statePath) ?: cache.getState(cardId, statePath)
fun updateState(tag: DivDataTag, stateId: Long, temporary: Boolean) {
if (DivDataTag.INVALID != tag) {
synchronized(states) {
val state = getState(tag)
states[tag] = if (state == null) DivViewState(stateId) else DivViewState(
stateId,
state.blockStates
)
temporaryCache.putRootState(tag.id, stateId.toString())
if (!temporary) {
cache.putRootState(tag.id, stateId.toString())
}
if (DivDataTag.INVALID == tag) return
synchronized(states) {
val state = getState(tag)
states[tag] = state?.let { DivViewState(stateId, it.blockStates) } ?: DivViewState(stateId)
temporaryCache.putRootState(tag.id, stateId.toString())
if (!temporary) {
cache.putRootState(tag.id, stateId.toString())
}
}
}
@@ -46,27 +65,59 @@ internal class DivStateManager @Inject constructor(
fun updateStates(cardId: String, divStatePath: DivStatePath, temporary: Boolean) {
val path = divStatePath.pathToLastState
val stateId = divStatePath.lastStateId
if (path != null && stateId != null) {
synchronized(states) {
temporaryCache.putState(cardId, path, stateId)
if (!temporary) {
cache.putState(cardId, path, stateId)
}
if (path == null || stateId == null) return
synchronized(states) {
temporaryCache.putState(cardId, path, stateId)
if (!temporary) {
cache.putState(cardId, path, stateId)
}
variables[cardId]?.get(path)?.setValue(stateId)
}
}
fun bindVariable(cardId: String, divStatePath: DivStatePath, variableUpdater: VariableUpdater) {
val cardVariables = variables[cardId] ?: return Assert.fail("State variables weren't collected before binding.")
cardVariables[divStatePath.statePath]?.variableUpdater = WeakReference(variableUpdater)
}
fun reset(tags: List<DivDataTag>) {
if (tags.isEmpty()) {
states.clear()
cache.clear()
temporaryCache.clear()
variables.clear()
} else {
tags.forEach { tag ->
states.remove(tag)
cache.resetCard(tag.id)
temporaryCache.resetCard(tag.id)
variables.remove(tag.id)
}
}
}
}
private class StateVariableHolder(val variable: Variable) {
var variableUpdater: WeakReference<VariableUpdater>? = null
fun setValue(value: String) {
variableUpdater?.get()?.invoke(value) ?: variable.set(value)
}
}
private class StateVariableCollector(
private val variables: CardVariables
) : DivTreeVisitor<Unit>() {
fun collectStateVariables(data: DivData, context: BindingContext) = visit(data, context)
override fun defaultVisit(data: Div, context: BindingContext, path: DivStatePath) {
if (data !is Div.State) return
val resolver = context.expressionResolver.asImpl ?: return
val variableName = data.value.stateIdVariable ?: return
val variable = resolver.getVariable(variableName) ?: return
variables.getOrPut(path.statePath) { StateVariableHolder(variable) }
}
}
@@ -213,6 +213,7 @@ class Div2View private constructor(
oldRuntimeStore?.clearBindings(this)
}
bindingContext = BindingContext(this, expressionResolver)
div2Component.stateManager.collectStateVariables(data, bindingContext)
}
private fun tryAttachVariableTriggers(data: DivData?) {
@@ -1433,7 +1434,6 @@ class Div2View private constructor(
switchToState(newState.stateId, isPendingStateTemporary)
} else if (childCount > 0) {
try {
val bindingContext = BindingContext(this@Div2View, expressionResolver)
viewComponent.stateSwitcher.switchStates(bindingContext, newState, pendingPaths.immutableCopy())
} catch (e: StateConflictException) {
logError(e)
@@ -18,8 +18,8 @@ import com.yandex.div.core.downloader.DivPatchManager
import com.yandex.div.core.expression.local.DivRuntimeVisitor
import com.yandex.div.core.expression.variables.TwoWayStringVariableBinder
import com.yandex.div.core.state.DivPathUtils.getId
import com.yandex.div.core.state.DivStateManager
import com.yandex.div.core.state.DivStatePath
import com.yandex.div.core.state.TemporaryDivStateCache
import com.yandex.div.core.util.androidInterpolator
import com.yandex.div.core.util.clearTreeAnimations
import com.yandex.div.core.util.containsStateInnerTransitions
@@ -50,7 +50,6 @@ import com.yandex.div.internal.KLog
import com.yandex.div.internal.widget.DivLayoutParams
import com.yandex.div.json.expressions.ExpressionResolver
import com.yandex.div.json.missingValue
import com.yandex.div.state.DivStateCache
import com.yandex.div2.Div
import com.yandex.div2.DivAction
import com.yandex.div2.DivAnimation
@@ -65,8 +64,7 @@ internal class DivStateBinder @Inject constructor(
private val baseBinder: DivBaseBinder,
private val viewCreator: DivViewCreator,
private val viewBinder: Provider<DivBinder>,
private val divStateCache: DivStateCache,
private val temporaryStateCache: TemporaryDivStateCache,
private val stateManager: DivStateManager,
private val divActionBinder: DivActionBinder,
private val divActionBeaconSender: DivActionBeaconSender,
private val divPatchManager: DivPatchManager,
@@ -83,7 +81,7 @@ internal class DivStateBinder @Inject constructor(
* @param context includes Div2View and ExpressionResolver for current Div.
* @param view layout with path 0/content/expanded/comments/expanded/comment_03/{any_state_here}.
* @param div [DivState], corresponding to path 0/content/expanded/comments/expanded/comment_03,
* Exact stateId will be set via [DivStateCache] or [TemporaryDivStateCache], and this class will
* Exact stateId will be set via [DivStateManager], and this class will
* handle receiving corresponding to the state [Div] by itself.
* @param path path 0/content/expanded/comments/expanded, so to previous [DivStateLayout].
*/
@@ -96,7 +94,11 @@ internal class DivStateBinder @Inject constructor(
errorCollectors.getOrCreate(context.divView.dataTag, context.divView.divData)
.logError(missingValue("id", path.toString()))
}
val (oldState, newState) = divValue.getStates(context, view, path, id)
val oldState = divValue.states.find { it.stateId == view.stateId }
?: divValue.getDefaultState(context.expressionResolver)
val currentStateId = getCurrentStateId(context, divValue, path, id)
val newState = divValue.states.find { it.stateId == currentStateId }
?: divValue.getDefaultState(context.expressionResolver)
if (oldState == null || newState == null) return
val oldDiv = view.activeStateDiv
@@ -108,25 +110,22 @@ internal class DivStateBinder @Inject constructor(
view.bindState(context, divValue, newState, oldDivState?.value, oldState, oldDiv, path, oldResolver, id)
}
private fun DivState.getStates(
private fun getCurrentStateId(
context: BindingContext,
view: DivStateLayout,
div: DivState,
path: DivStatePath,
id: String,
): Pair<DivState.State?, DivState.State?> {
): String? {
div.getStateIdVariableValue(context.expressionResolver)?.let { return it.toString() }
val cardId = context.divView.divTag.id
val statePath = "${path.statesString}/$id"
val stateId = (temporaryStateCache.getState(cardId, statePath) ?: divStateCache.getState(cardId, statePath))
?.also { view.variableUpdater?.invoke(it) }
?: stateIdVariable?.let { getValueFromVariable(context, it) }
val oldState = states.find { it.stateId == view.stateId }
?: getDefaultState(context.expressionResolver)
val newState = states.find { it.stateId == stateId }
?: getDefaultState(context.expressionResolver)
return Pair(oldState, newState)
return stateManager.getState(cardId, statePath)
}
private fun DivState.getStateIdVariableValue(resolver: ExpressionResolver) =
stateIdVariable?.let { resolver.getVariable(it)?.getValue() }
private fun DivStateLayout.bind(
context: BindingContext,
div: DivState,
@@ -306,9 +305,6 @@ internal class DivStateBinder @Inject constructor(
return div.value.contentAlignmentHorizontal.evaluate(resolver)
}
private fun getValueFromVariable(context: BindingContext, variableName: String) =
context.expressionResolver.getVariable(variableName)?.getValue()?.toString()
private fun DivStateLayout.observeStateIdVariable(
div: DivState,
bindingContext: BindingContext,
@@ -328,7 +324,7 @@ internal class DivStateBinder @Inject constructor(
}
override fun setViewStateChangeListener(valueUpdater: (String) -> Unit) {
variableUpdater = valueUpdater
stateManager.bindVariable(bindingContext.divView.dataTag.id, divStatePath, valueUpdater)
}
},
path = divStatePath
@@ -38,7 +38,6 @@ internal class DivStateLayout @JvmOverloads constructor(
private val gestureDetector = GestureDetectorCompat(context, swipeListener, Handler(Looper.getMainLooper()))
var swipeOutCallback: (() -> Unit)? = null
internal var activeStateDiv: Div? = null
var variableUpdater: ((String) -> Unit)? = null
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
if (swipeOutCallback == null) {
@@ -7,14 +7,13 @@ import com.yandex.div.core.downloader.DivPatchCache
import com.yandex.div.core.downloader.DivPatchManager
import com.yandex.div.core.expression.variables.TwoWayStringVariableBinder
import com.yandex.div.core.state.DivPathUtils.findStateLayout
import com.yandex.div.core.state.DivStateManager
import com.yandex.div.core.state.DivStatePath
import com.yandex.div.core.state.TemporaryDivStateCache
import com.yandex.div.core.view2.DivBinder
import com.yandex.div.core.view2.DivVisibilityActionTracker
import com.yandex.div.core.view2.divs.widgets.DivStateLayout
import com.yandex.div.core.view2.errors.ErrorCollectors
import com.yandex.div.json.expressions.ExpressionResolver
import com.yandex.div.state.InMemoryDivStateCache
import com.yandex.div2.Div
import org.junit.Assert
import org.junit.Test
@@ -24,6 +23,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.robolectric.RobolectricTestRunner
private const val STATE_DIR = "div-state"
@@ -35,8 +35,7 @@ class DivStateBinderReleaseViewTest: DivBinderTest() {
private val divTwo = UnitTestData(STATE_DIR, "state_list.json")
private val viewBinder = mock<DivBinder>()
private val stateCache = InMemoryDivStateCache()
private val temporaryStateCache = TemporaryDivStateCache()
private val stateManager = mock<DivStateManager>()
private val div2Logger = mock<Div2Logger>()
private val divVisibilityActionTracker = mock<DivVisibilityActionTracker>()
private val errorCollectors = mock<ErrorCollectors>()
@@ -54,8 +53,7 @@ class DivStateBinderReleaseViewTest: DivBinderTest() {
baseBinder = baseBinder,
viewCreator = viewCreator,
viewBinder = { viewBinder },
divStateCache = stateCache,
temporaryStateCache = temporaryStateCache,
stateManager = stateManager,
divActionBinder = actionBinder,
divActionBeaconSender = divActionBeaconSender,
divPatchManager = divPatchManager,
@@ -88,7 +86,7 @@ class DivStateBinderReleaseViewTest: DivBinderTest() {
@Test
fun `change state release old views`() {
stateBinder.bindView(bindingContext, stateLayout, divOne.asDivState, rootPath)
switchToState("second")
whenever(stateManager.getState(cardId = CARD_ID, statePath = "0/state_container")).thenReturn("second")
val stateToBeSwitched: DivStateLayout = stateLayout
.findStateLayout(DivStatePath.parse("0/state_container/first"))
?: throw AssertionError("failed to find state")
@@ -106,11 +104,6 @@ class DivStateBinderReleaseViewTest: DivBinderTest() {
}
verify(visitor, times(allChildren.size)).release(any())
}
private fun switchToState(stateId: String, temporaryStateId: String = stateId) {
stateCache.putState(cardId = CARD_ID, path = "0/state_container", state = stateId)
temporaryStateCache.putState(cardId = CARD_ID, path = "0/state_container", stateId = temporaryStateId)
}
}
private val UnitTestData.asDivState get() = div as Div.State
@@ -4,14 +4,13 @@ import com.yandex.div.core.Div2Logger
import com.yandex.div.core.downloader.DivPatchCache
import com.yandex.div.core.downloader.DivPatchManager
import com.yandex.div.core.expression.variables.TwoWayStringVariableBinder
import com.yandex.div.core.state.DivStateManager
import com.yandex.div.core.state.DivStatePath
import com.yandex.div.core.state.TemporaryDivStateCache
import com.yandex.div.core.view2.DivBinder
import com.yandex.div.core.view2.DivVisibilityActionTracker
import com.yandex.div.core.view2.divs.widgets.DivStateLayout
import com.yandex.div.core.view2.errors.ErrorCollectors
import com.yandex.div.json.expressions.ExpressionResolver
import com.yandex.div.state.InMemoryDivStateCache
import com.yandex.div2.Div
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
@@ -26,6 +25,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
@@ -33,8 +33,7 @@ class DivStateBinderTest: DivBinderTest() {
private val viewBinder = mock<DivBinder>()
private val divActionBinder = mock<DivActionBinder>()
private val stateCache = InMemoryDivStateCache()
private val temporaryStateCache = TemporaryDivStateCache()
private val stateManager = mock<DivStateManager>()
private val div2Logger = mock<Div2Logger>()
private val divVisibilityActionTracker = mock<DivVisibilityActionTracker>()
private val errorCollectors = mock<ErrorCollectors>()
@@ -54,8 +53,7 @@ class DivStateBinderTest: DivBinderTest() {
baseBinder = baseBinder,
viewCreator = viewCreator,
viewBinder = { viewBinder },
divStateCache = stateCache,
temporaryStateCache = temporaryStateCache,
stateManager = stateManager,
divActionBinder = divActionBinder,
divActionBeaconSender = divActionBeaconSender,
divPatchManager = divPatchManager,
@@ -118,15 +116,6 @@ class DivStateBinderTest: DivBinderTest() {
assertStateBound(pathToState("second"), expectedStateDiv)
}
@Test
fun `selected temporary state bound`() {
switchToState(stateId = "first", temporaryStateId = "second")
stateBinder.bindView(bindingContext, stateLayout, div, rootPath)
val expectedStateDiv = divState.states[1].div!!
assertStateBound(pathToState("second"), expectedStateDiv)
}
@Test
fun `empty state not bound`() {
clearInvocations(viewCreator)
@@ -261,9 +250,8 @@ class DivStateBinderTest: DivBinderTest() {
verify(divView).bindViewToDiv(stateLayout.getChildAt(0), newData.value.states[0].div!!)
}
private fun switchToState(stateId: String, temporaryStateId: String = stateId) {
stateCache.putState(cardId = CARD_ID, path = "0/state_container", state = stateId)
temporaryStateCache.putState(cardId = CARD_ID, path = "0/state_container", stateId = temporaryStateId)
private fun switchToState(stateId: String) {
whenever(stateManager.getState(cardId = CARD_ID, statePath = "0/state_container")).thenReturn(stateId)
}
private fun pathToState(stateId: String): DivStatePath {
@@ -1,6 +1,7 @@
{
"description": "State variable has higher priority than cached state.",
"platforms": [
"android",
"ios",
"web"
],
@@ -1,6 +1,7 @@
{
"description": "State variable value is synchronized with state changes by actions.",
"platforms": [
"android",
"ios",
"web"
],