From e388c914195f5fb5422bc28371fb9992b878695d Mon Sep 17 00:00:00 2001 From: Tim Froehlich Date: Tue, 3 Dec 2024 16:12:03 +0000 Subject: [PATCH] Convert ViewStyle to Proto (#1810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Tree of downstream PRs as of 2024-11-27 * **PR #1810 (THIS ONE)**: `main` ← `wb/froeht/1733-viewstyle` * PR #1811: `wb/froeht/1733-viewstyle` ← `wb/froeht/1732-component` * PR #1813: `wb/froeht/1732-component` ← `wb/froeht/1735-view` Fixes #1736 --- .idea/runConfigurations/Figma_Fetch_Tests.xml | 1 + crates/dc_bundle/src/definition/view.rs | 220 +++++++- .../dc_bundle/src/legacy_definition/view.rs | 1 - .../src/legacy_definition/view/component.rs | 3 +- .../src/legacy_definition/view/view.rs | 3 +- .../src/legacy_definition/view/view_style.rs | 223 -------- crates/figma_import/src/reflection.rs | 2 +- crates/figma_import/src/tools/fetch_layout.rs | 28 +- crates/figma_import/src/transform_flexbox.rs | 345 ++++++------ .../figma_import/tests/layout-unit-tests.dcf | Bin 27942 -> 28024 bytes crates/figma_import/tests/layout_tests.rs | 22 +- crates/figma_import/tests/test_fetches.rs | 23 + ...signSwitcherDoc_Ljph4e3sC0lHcynfXpoh9f.dcf | Bin 404082 -> 405339 bytes .../com/android/designcompose/ComputePaths.kt | 17 +- .../com/android/designcompose/DesignFrame.kt | 68 +-- .../com/android/designcompose/DesignText.kt | 50 +- .../com/android/designcompose/DesignView.kt | 3 +- .../com/android/designcompose/FrameRender.kt | 82 +-- .../java/com/android/designcompose/Layout.kt | 54 +- .../java/com/android/designcompose/Utils.kt | 504 +++++++++--------- .../android/designcompose/proto/ProtoUtils.kt | 15 + .../designcompose/squoosh/SquooshAnimate.kt | 31 +- .../designcompose/squoosh/SquooshLayout.kt | 3 +- .../designcompose/squoosh/SquooshRender.kt | 21 +- .../designcompose/squoosh/SquooshRoot.kt | 5 +- .../designcompose/squoosh/SquooshText.kt | 23 +- .../squoosh/SquooshTreeBuilder.kt | 14 +- .../res/raw/raw_resource_test_hello_world_doc | Bin 3789 -> 3799 bytes .../BattleshipDoc_RfGl9SWnBEvdg8T1Ex6ZAR.dcf | Bin 905837 -> 0 bytes ...lignmentTestDoc_JIjE9oKQbq8ipi66ab5UaK.dcf | Bin 449788 -> 451104 bytes ...utMinMaxTestDoc_ArHVZAQIsKf2B9mATnVvLX.dcf | Bin 27715 -> 27805 bytes .../BattleshipDoc_RfGl9SWnBEvdg8T1Ex6ZAR.dcf | Bin 1032621 -> 1035779 bytes ...lendModeTestDoc_ZqX5i5g6inv9tANIwMMXUV.dcf | Bin 68684 -> 68890 bytes ...olorTintTestDoc_MCtUD3yjONxK6rQm65yqM5.dcf | Bin 1518 -> 1522 bytes ...onentReplaceDoc_bQVVy2GSZJ8veYaJUrG6Ni.dcf | Bin 19906 -> 19960 bytes ...laceRelayoutDoc_qIh0IOQTCtgeAWZFF5gYSk.dcf | Bin 3863 -> 3875 bytes ...tTapCallbackDoc_1jeKYynjk1nqYblZ66QDDK.dcf | Bin 8886 -> 8914 bytes ...ingViewsTestDoc_9g0jn7KXNloRmOZIGze2Rr.dcf | Bin 5708 -> 0 bytes .../ConstraintsDoc_KuHLbsKA23DjZPhhgHqt71.dcf | Bin 27774 -> 27858 bytes ...AxisFillTestDoc_GPr1cx4n3zBPwLhqlSL1ba.dcf | Bin 10193 -> 10223 bytes ...tomBrushTestDoc_oetCBVw8gCAxmCNllXx7zO.dcf | Bin 7094 -> 7106 bytes ...lsGaugesTestDoc_lZj6E9GtIQQE4HNLpzgETw.dcf | Bin 252882 -> 253176 bytes ...ancyFillTestDoc_xQ9cunHt8VUm6xqJJ2Pjb2.dcf | Bin 79584 -> 79662 bytes .../FillTestDoc_dB3q96FkxkTO4czn5NqnxV.dcf | Bin 3356 -> 3366 bytes .../GridLayoutDoc_MBNjjSbzzKeN7nBjVoewsl.dcf | Bin 32450 -> 32518 bytes ...idLayoutTestDoc_JOSOEvsrjvMqanyQa5OpNR.dcf | Bin 164195 -> 164479 bytes ...idWidgetTestDoc_OBhNItd9i9J2LwVYuLxEIx.dcf | Bin 320128 -> 320642 bytes .../HelloByeDoc_MCHaMYcIEnRpbvU9Ms7a0o.dcf | Bin 3537 -> 3547 bytes ...nDoc_v62Vwlxa4Bb6nopJiAxQAQ_5668177823.dcf | Bin 29409 -> 29419 bytes .../HelloWorldDoc_pxVlixodJqZL95zo2RzTHl.dcf | Bin 3868 -> 3878 bytes ...nkValidationDoc_uBExbEg4lcRa0xN2yaLTX8.dcf | Bin 3562 -> 3568 bytes ...toLayoutTestDoc_vPNR6N02HfdcpC8wR5yBYP.dcf | Bin 3478 -> 3488 bytes ...geUpdateTestDoc_oQw7kiy94fvdVouCYBC9T0.dcf | Bin 23068 -> 23074 bytes ...eractionTestDoc_8Zg9viyjYTnyN29pbkR1CE.dcf | Bin 318414 -> 319398 bytes ...mSpacingTestDoc_YXrHBp6C6OaW5ShcCYeGJc.dcf | Bin 37488 -> 37606 bytes ...lacementTestDoc_dwk2GF7RiNvlbbAKPjqldx.dcf | Bin 14445 -> 14489 bytes .../LayoutTestsDoc_Gv63fYTzpeH2ZtxP4go31E.dcf | Bin 194416 -> 194902 bytes ...stWidgetTestDoc_9ev0MBNHFrgTqJOrAGcEpV.dcf | Bin 259187 -> 259711 bytes .../MaskTestDoc_mEmdUVEIjvBBbV0kELPy37.dcf | Bin 34865 -> 34947 bytes ...oduleExampleDoc_hPEGkrF0LUqNYEZObXqjXZ.dcf | Bin 34962 -> 35070 bytes ...ePxSeparatorDoc_EXjTHxfMNBtXDrz8hr6MFB.dcf | Bin 17172 -> 17218 bytes ...OpenLinkTestDoc_r7m4tqyKv6y9DWcg7QBEDf.dcf | Bin 26231 -> 26307 bytes ...stomizationsDoc_o0GWzcqdOWEgzj4kIeIlAu.dcf | Bin 7058 -> 7080 bytes .../ShadowsTestDoc_OqK58Y46IqP4wIgKCWys48.dcf | Bin 204125 -> 204709 bytes ...tAnimateTestDoc_RW3lFurXCoVDeqY2Y7bf4v.dcf | Bin 1898080 -> 1899222 bytes ...stomizationsDoc_POWyniB6moGRmhZTJyejwa.dcf | Bin 22167 -> 22306 bytes ...yledTextRunsDoc_mIYV4YsYYaMTsBMCVskA4N.dcf | Bin 6518 -> 6534 bytes ...TelltaleTestDoc_TZgHrKWx8wvQM7UPTyEpmz.dcf | Bin 52782 -> 52908 bytes ...extElideTestDoc_oQ7nK49Ya5PJ3GpjI5iy8d.dcf | Bin 6968 -> 6986 bytes ...ResizingTestDoc_kAoYvgHkPzA4J4pALZ3Xhg.dcf | Bin 8705 -> 8731 bytes ...leBorderTestDoc_MWnVAfW3FupV4VMLNR1m67.dcf | Bin 27769 -> 27829 bytes ...ariablesTestDoc_HhGxvL4aHhP8ALsLNz56TP.dcf | Bin 58407 -> 58439 bytes ...nimationTestDoc_pghyUUhlzJNoxxSK86ngiw.dcf | Bin 1348155 -> 1348321 bytes ...TimelineTestDoc_vJRf4zxY4QX4zzSSUd1nJ5.dcf | Bin 1734195 -> 1734863 bytes ...AsteriskTestDoc_gQeYHGCSaBE4zYSFpBrhre.dcf | Bin 27561 -> 27647 bytes ...ractionsTestDoc_WcsgoLR4aDRSkZHY29Qdhq.dcf | Bin 55327 -> 55491 bytes ...opertiesTestDoc_4P7zDdrQxj7FZsKJoIQcx1.dcf | Bin 134790 -> 135198 bytes ...enderingTestDoc_Z3ucY0wMAbIwZIa6mLEWIK.dcf | Bin 93001 -> 93195 bytes .../HelloWorldDoc_pxVlixodJqZL95zo2RzTHl.dcf | Bin 3789 -> 3799 bytes .../TutorialDoc_3z4xExq0INrL9vxPhj9tl7.dcf | Bin 56237 -> 56391 bytes 80 files changed, 908 insertions(+), 853 deletions(-) delete mode 100644 crates/dc_bundle/src/legacy_definition/view/view_style.rs delete mode 100644 integration-tests/benchmarks/battleship/lib/src/main/assets/figma/BattleshipDoc_RfGl9SWnBEvdg8T1Ex6ZAR.dcf delete mode 100644 integration-tests/validation/src/main/assets/figma/CompositingViewsTestDoc_9g0jn7KXNloRmOZIGze2Rr.dcf diff --git a/.idea/runConfigurations/Figma_Fetch_Tests.xml b/.idea/runConfigurations/Figma_Fetch_Tests.xml index d192fb2ec..3d3ed7941 100644 --- a/.idea/runConfigurations/Figma_Fetch_Tests.xml +++ b/.idea/runConfigurations/Figma_Fetch_Tests.xml @@ -1,5 +1,6 @@ +