Compare commits
913 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ddf748a99d | ||
|
4d16ee4ed4 | ||
|
b72efaaaca | ||
|
6327893b9b | ||
|
8c3ee81d6e | ||
|
fb07dcff40 | ||
|
27f42c90db | ||
|
688bd4ef72 | ||
|
42bba10894 | ||
|
495d8da596 | ||
|
869a33eb13 | ||
|
050893f15a | ||
|
8aa67abdb2 | ||
|
2e321fc69f | ||
|
aa2610c2dd | ||
|
293b657aef | ||
|
d6591439d1 | ||
|
2ef674edd3 | ||
|
22a60e82b0 | ||
|
34739ec652 | ||
|
b9b0217a07 | ||
|
7c2683fe52 | ||
|
ee73f556b4 | ||
|
34b68cf1d2 | ||
|
8975019269 | ||
|
6e6b1369ac | ||
|
25b8c94788 | ||
|
3fce27c48c | ||
|
32a973ebd1 | ||
|
c37f5956e4 | ||
|
0875b6b542 | ||
|
b29e144649 | ||
|
f00116c3a6 | ||
|
f1baf8336b | ||
|
36eae205e1 | ||
|
ad5b3410f0 | ||
|
e2dbff0ca6 | ||
|
96eb94afd0 | ||
|
9100019c0a | ||
|
21f814b2a6 | ||
|
499d28d021 | ||
|
d697bbe0a5 | ||
|
67a3841164 | ||
|
6ac38d188c | ||
|
8216c54b05 | ||
|
968c075e39 | ||
|
26dbe8b4ff | ||
|
a5c2f7f27a | ||
|
10811e1a94 | ||
|
10f4bceac0 | ||
|
47717324d4 | ||
|
1043c35f2b | ||
|
fde89b056d | ||
|
a08a57b33c | ||
|
31de91bbac | ||
|
e6e224ce48 | ||
|
a04a6b5e8f | ||
|
442d84ccfc | ||
|
4a2ccc658e | ||
|
58622fa747 | ||
|
90cded3819 | ||
|
d1e188341b | ||
|
0f2350308e | ||
|
9b120eded9 | ||
|
a218880216 | ||
|
1a2802028b | ||
|
a37b286bae | ||
|
dcfdb955b3 | ||
|
72cefead02 | ||
|
884e064a99 | ||
|
3ed9bec05c | ||
|
dadf0473b7 | ||
|
947230958d | ||
|
095c991b85 | ||
|
825da1e868 | ||
|
5a25805cb5 | ||
|
adff8d96dd | ||
|
8c270e68cc | ||
|
a2aa1b7fca | ||
|
ae956f06fb | ||
|
8c0eed3c75 | ||
|
4e4ef06de1 | ||
|
a53c14dc75 | ||
|
c99fc9c4da | ||
|
2fb857d73d | ||
|
e6dfe04388 | ||
|
5e40e4b682 | ||
|
7c891db9af | ||
|
6d916ab063 | ||
|
59d680f4e9 | ||
|
be305b5d0f | ||
|
d676d917e3 | ||
|
838fc3f019 | ||
|
296982a29e | ||
|
1d0668692b | ||
|
39e512f691 | ||
|
0f250490d4 | ||
|
eeae39d707 | ||
|
ce517689ff | ||
|
9c82ba783f | ||
|
1c8e8d3aec | ||
|
cc27d85110 | ||
|
cd5324378d | ||
|
c6ae314202 | ||
|
73224c62b5 | ||
|
2c6a4485f5 | ||
|
cf005df828 | ||
|
f539d68049 | ||
|
39996512fc | ||
|
2dc5a16d1f | ||
|
d667ebd66e | ||
|
2b8217ce8d | ||
|
9dac56e824 | ||
|
a7e8aec3d9 | ||
|
6b5bf570c8 | ||
|
a130ac2f9c | ||
|
19fd066507 | ||
|
204e849218 | ||
|
8ff13c922a | ||
|
af219f8836 | ||
|
e33123f955 | ||
|
755fa07b39 | ||
|
2701d80078 | ||
|
c393ed1381 | ||
|
a4bdd9cd9b | ||
|
4a4325afb6 | ||
|
586eb6102a | ||
|
b1e6793460 | ||
|
8b17459254 | ||
|
195c166efe | ||
|
0908d3a173 | ||
|
f304990656 | ||
|
cea3865c74 | ||
|
b74c0d4766 | ||
|
54e863cef2 | ||
|
1938792517 | ||
|
aa71dbb5bd | ||
|
8dc46c0a87 | ||
|
1180afed9c | ||
|
1562bce9b4 | ||
|
a9514513a7 | ||
|
cf809b8e8b | ||
|
d7ff5c0689 | ||
|
e3156279fc | ||
|
0ce42d83e0 | ||
|
afc1108659 | ||
|
a15bf6e701 | ||
|
74fc37efc8 | ||
|
5824dbda66 | ||
|
e96a09e5ff | ||
|
9e20dfeea1 | ||
|
6e04631862 | ||
|
88b23ebb3d | ||
|
018916403e | ||
|
af38fd31f8 | ||
|
1e0ebdae2f | ||
|
1adbafe950 | ||
|
e51ca95713 | ||
|
a803421739 | ||
|
011c1964a0 | ||
|
05d205cf89 | ||
|
0a4f7bd558 | ||
|
cea862a6bf | ||
|
cc02a20c9e | ||
|
98fda9c587 | ||
|
2eed95f3e4 | ||
|
e5d3baca81 | ||
|
dee93017f7 | ||
|
e167642672 | ||
|
e9bb1efb03 | ||
|
3f7d03b443 | ||
|
ffce716557 | ||
|
fcfb19e9cf | ||
|
c5f105a7b6 | ||
|
b062d23947 | ||
|
7fc6fcb38c | ||
|
bc7e504b29 | ||
|
3d8afa9e90 | ||
|
a1e47e37ae | ||
|
e0bc0ebe29 | ||
|
498c0ff4bf | ||
|
d42d43e90f | ||
|
bfc6319daa | ||
|
74ce5afd9e | ||
|
c11faf2d56 | ||
|
5fad8008ab | ||
|
948ade4b1c | ||
|
b1a7f2b4d9 | ||
|
d44a6d936f | ||
|
1fc8472d35 | ||
|
c235301b52 | ||
|
2fb81500c1 | ||
|
68d9209dd9 | ||
|
e91569cdad | ||
|
f31917aa01 | ||
|
74202aecff | ||
|
9c2108c69e | ||
|
3d2836a947 | ||
|
e4856a2264 | ||
|
a2ee0f65bd | ||
|
85352c4e45 | ||
|
7d7b7b9e18 | ||
|
62d8a911ff | ||
|
ca46c67e9e | ||
|
5bb2265083 | ||
|
ab3bf40c7d | ||
|
f273e80c77 | ||
|
1471be54e3 | ||
|
f039835249 | ||
|
f793ba2d6b | ||
|
9f72ad05ce | ||
|
14f3827491 | ||
|
0d96098fd9 | ||
|
42e3b78f04 | ||
|
3ad49d27d9 | ||
|
3331a9e480 | ||
|
7890672ecc | ||
|
d7bfbf3646 | ||
|
6d271c05f6 | ||
|
a9bddf87ff | ||
|
88994129ae | ||
|
888892885e | ||
|
de79f2a1d4 | ||
|
6368416178 | ||
|
a935a222b5 | ||
|
7c4da0a341 | ||
|
b047af25ca | ||
|
2abd9dd91b | ||
|
afadc5cf6b | ||
|
8823cc357a | ||
|
8b8d9a05b7 | ||
|
15668aceb6 | ||
|
e25fe994b3 | ||
|
47abe1c482 | ||
|
95169c3150 | ||
|
7331de78bd | ||
|
05f36a835a | ||
|
dcd9438488 | ||
|
d38db1292c | ||
|
4463fe0856 | ||
|
2156de5fb5 | ||
|
b1c749075d | ||
|
367a93de88 | ||
|
2643b96589 | ||
|
016a10df26 | ||
|
cbcf07f08a | ||
|
59bcac3289 | ||
|
bd90192df9 | ||
|
e7fcf1ee65 | ||
|
f86c74ce7e | ||
|
d5ad51bccc | ||
|
0bdf36f5d1 | ||
|
1b9053bc5d | ||
|
446101a168 | ||
|
f0324035bf | ||
|
a2f94cbf9a | ||
|
d21fa68033 | ||
|
5a6d84abc9 | ||
|
61ae484316 | ||
|
42657017bd | ||
|
9b9a344934 | ||
|
5f92ba49a7 | ||
|
2e564c21cd | ||
|
ca7d4d1633 | ||
|
3645f43cea | ||
|
9378a7a439 | ||
|
d3e02b15fa | ||
|
80d527814e | ||
|
5121fef5d8 | ||
|
0d026bd1a0 | ||
|
719fa3cca3 | ||
|
307cf09434 | ||
|
8691cdaed6 | ||
|
4a6b1e19b8 | ||
|
31ce3ab866 | ||
|
0846439c8e | ||
|
000d1436b4 | ||
|
1bc97a5e48 | ||
|
68f7001ed4 | ||
|
59446294b3 | ||
|
460370b7d3 | ||
|
cbea5d44b8 | ||
|
b4b009c2d8 | ||
|
74dd627495 | ||
|
58f0cca7c7 | ||
|
3de3575ac4 | ||
|
390fade8c0 | ||
|
96dfe068ee | ||
|
e0eb37fce0 | ||
|
79355ab72d | ||
|
5a9f29debb | ||
|
8b8932811e | ||
|
604a9a98a9 | ||
|
71321f763a | ||
|
7fa0816d81 | ||
|
4840495d3f | ||
|
866bf101b2 | ||
|
3467308874 | ||
|
ef2c693b05 | ||
|
efac22a508 | ||
|
4b97375524 | ||
|
ab9d06abf5 | ||
|
5ee32fbefc | ||
|
899664dddd | ||
|
b66642cb86 | ||
|
b9ae948ce9 | ||
|
138521ccc2 | ||
|
5514722ce2 | ||
|
56e133ab4c | ||
|
f6415889ca | ||
|
885b4cbdfb | ||
|
8461aeaef0 | ||
|
3df41aefdb | ||
|
8bc89651d6 | ||
|
c5f2444048 | ||
|
130a9a2aa2 | ||
|
dd97fcc968 | ||
|
4f51871fa8 | ||
|
e96d14395c | ||
|
852db1d885 | ||
|
3f79439718 | ||
|
96d93f2982 | ||
|
236bcc1a39 | ||
|
4b5ae211da | ||
|
aaa018bbea | ||
|
6bdd39d0ed | ||
|
da678ef971 | ||
|
e9078374c9 | ||
|
f23a669ed0 | ||
|
9ddda3c630 | ||
|
8ab01fde6e | ||
|
440c719190 | ||
|
e522b2dee4 | ||
|
b26e637c81 | ||
|
6b7f6980f9 | ||
|
4248fd9d4c | ||
|
5a65261a55 | ||
|
5719132f58 | ||
|
10b316f315 | ||
|
b6498987fa | ||
|
9680ae98a6 | ||
|
59755d2874 | ||
|
64c37767c2 | ||
|
50ec35575f | ||
|
ed3b54b603 | ||
|
ed5c5a799f | ||
|
d19da9e528 | ||
|
0962c5220c | ||
|
b9972cee6e | ||
|
98c1c180af | ||
|
6f6e0ce339 | ||
|
bdae838516 | ||
|
6d8ee77791 | ||
|
9725d5b21b | ||
|
8e48edaa0b | ||
|
89394a2dd6 | ||
|
02a2309b2a | ||
|
8f181c7259 | ||
|
339c5574b8 | ||
|
8d5bbecd3d | ||
|
dd12907632 | ||
|
7d7d9a7ef0 | ||
|
63570613d3 | ||
|
4e2011c381 | ||
|
7a60399b2b | ||
|
a0b3586fb3 | ||
|
a2ef8978cd | ||
|
d02f4a94de | ||
|
b7890fa2a8 | ||
|
1e4d0abc66 | ||
|
eb2aeb3adb | ||
|
fad2ee1a64 | ||
|
ba9bd4eae3 | ||
|
e12b78f99b | ||
|
5d1cee2bf0 | ||
|
5c711a7076 | ||
|
838ef47847 | ||
|
786ccddd7b | ||
|
b747286c1d | ||
|
bb3c2b2498 | ||
|
36e732aabd | ||
|
d6517ae288 | ||
|
93d327acfb | ||
|
01c6c79efb | ||
|
357ca78f9f | ||
|
6e46eec58f | ||
|
554d8cdf76 | ||
|
328ec7dc4d | ||
|
2e66f8d828 | ||
|
e224a29d1c | ||
|
238d7ba98f | ||
|
d6ba8326d1 | ||
|
f7df575746 | ||
|
2b52c73d70 | ||
|
7a45fb39bf | ||
|
1080cf22e3 | ||
|
1d09227374 | ||
|
85031baaf2 | ||
|
7f71cac3b0 | ||
|
48a8f883ba | ||
|
6132a59772 | ||
|
8309cfc976 | ||
|
abc9fdb37c | ||
|
b872751d68 | ||
|
8368338c93 | ||
|
45c44d293c | ||
|
b4a889553c | ||
|
78cdf3cadc | ||
|
be78bfbd8c | ||
|
c5d4485db3 | ||
|
71f1d99494 | ||
|
0e99980206 | ||
|
292bfed102 | ||
|
78d6988461 | ||
|
3499e2e0ef | ||
|
b1821ab4cd | ||
|
006f6460a9 | ||
|
db5bc092aa | ||
|
9fe20fd2fc | ||
|
7b87ded288 | ||
|
eaaf0fdfe2 | ||
|
4caed8feb5 | ||
|
4be229059c | ||
|
389f2fd85d | ||
|
f95e3b49e9 | ||
|
f172d5d41c | ||
|
7be9fd1a79 | ||
|
5e1796505d | ||
|
51a4601e18 | ||
|
0bc4d23e2e | ||
|
4c47dcbd0f | ||
|
c1a9f6120a | ||
|
1b32c4f054 | ||
|
896cfbdfde | ||
|
910aa77c01 | ||
|
2562c029b1 | ||
|
0b1780a081 | ||
|
e9e2ae28e0 | ||
|
4ed3dd4b82 | ||
|
a7f430a5ef | ||
|
89ba4f282d | ||
|
b6231ee0ed | ||
|
e384002878 | ||
|
9ceed4b601 | ||
|
765bb85d1e | ||
|
6548dddec3 | ||
|
966f5ece4a | ||
|
ede2888326 | ||
|
2eda444bbf | ||
|
7c4319181b | ||
|
f4d29e6f11 | ||
|
77ea79490f | ||
|
46c96ee2cb | ||
|
a67c555320 | ||
|
cdb1ee21a0 | ||
|
2ce219ef42 | ||
|
c5f826de83 | ||
|
526ca42d04 | ||
|
b47f0ce41a | ||
|
eb7cb11ffd | ||
|
f9df990177 | ||
|
684dccb7b9 | ||
|
6c51eb4f72 | ||
|
ca485dfb50 | ||
|
50e3714b21 | ||
|
c52c7cdd1e | ||
|
11200f3d75 | ||
|
5dbe3c128b | ||
|
3564ccf6e4 | ||
|
e1c19cecad | ||
|
8e4f3a3084 | ||
|
9b8323ff38 | ||
|
5b7adda620 | ||
|
ba2a3b8c91 | ||
|
eb15939c23 | ||
|
b9fa60fd74 | ||
|
d397aa04d7 | ||
|
adb1b11055 | ||
|
2e234473ca | ||
|
6b08db68bb | ||
|
9550126f76 | ||
|
bad262b961 | ||
|
3c6c10075a | ||
|
6a77a6939e | ||
|
b725a4a140 | ||
|
2b714a5b5d | ||
|
572546088f | ||
|
5b109578d3 | ||
|
77b720f9a5 | ||
|
de954eb9cc | ||
|
3e322e60e4 | ||
|
a3642541d0 | ||
|
bb139d3f91 | ||
|
08743a42e2 | ||
|
cb6e76973d | ||
|
4b760fa9bc | ||
|
5730be093e | ||
|
d85e2ee9c3 | ||
|
fe433b012f | ||
|
5e3ffb39a2 | ||
|
f0edefdbb7 | ||
|
17901ea5c2 | ||
|
187fc54596 | ||
|
c951ad7c7b | ||
|
9785975f77 | ||
|
79281049f2 | ||
|
7d2b84aab6 | ||
|
cda328fa7e | ||
|
5d7b75a47a | ||
|
ae86824636 | ||
|
0dde40ce0b | ||
|
369c9ad12a | ||
|
cfb9eeca20 | ||
|
3dfb68887d | ||
|
d567885070 | ||
|
877c275a13 | ||
|
8aadae8ce4 | ||
|
2232d7603a | ||
|
b3f8851bc2 | ||
|
47ad3f63cf | ||
|
c75adb0671 | ||
|
178b8f5f64 | ||
|
a874992e7c | ||
|
31fc287d35 | ||
|
892913a69d | ||
|
99026e42a9 | ||
|
3a82d2b1a8 | ||
|
b28292e454 | ||
|
2ff18bc948 | ||
|
d0bee487e0 | ||
|
419e29c5a6 | ||
|
295d111f0e | ||
|
da5eb2db67 | ||
|
3408e4d4fa | ||
|
6d7eca8e42 | ||
|
5726a71b62 | ||
|
f73b5057ac | ||
|
51051aad7f | ||
|
91d3c08248 | ||
|
52f2cf319a | ||
|
bbdb62e654 | ||
|
e024943c4b | ||
|
7f44ec512e | ||
|
a2b6ddb7b1 | ||
|
bdc37b0797 | ||
|
82aaebfea2 | ||
|
48d82224ee | ||
|
100afcfdb0 | ||
|
b3436d5eba | ||
|
c5371aca64 | ||
|
269619a419 | ||
|
9b3104577c | ||
|
a1697d2307 | ||
|
056b75858c | ||
|
c84ed90272 | ||
|
b21dd9891a | ||
|
bba81781af | ||
|
0c74a72fac | ||
|
1822bc5eaf | ||
|
01ffe10c2f | ||
|
7f99a547f5 | ||
|
0e5651fb80 | ||
|
0ca44f3001 | ||
|
3f85763797 | ||
|
b318c4c5c9 | ||
|
ae9703712a | ||
|
d617ab6662 | ||
|
4c3eebd3e5 | ||
|
10061af491 | ||
|
91621641e6 | ||
|
35c6931ade | ||
|
44622912a2 | ||
|
aac40cf89b | ||
|
d4b20f5793 | ||
|
89df2d9475 | ||
|
79fa6f8d58 | ||
|
69242938f7 | ||
|
1b66b5d941 | ||
|
fb30f7ddcb | ||
|
747c2a4208 | ||
|
43fda26275 | ||
|
b1222bf83e | ||
|
3ec41b656f | ||
|
740ef6cd9e | ||
|
8c5cbf698b | ||
|
5f2cf6623f | ||
|
4b7efb73d7 | ||
|
a6b7e34187 | ||
|
e50308e823 | ||
|
b6a13ce43a | ||
|
96a87a811d | ||
|
025ee03cb1 | ||
|
c06ee92251 | ||
|
3aca5965dc | ||
|
cac77e5ffa | ||
|
49f1d7b5f6 | ||
|
82e44dbf04 | ||
|
9b501dd9eb | ||
|
8ba663f6f4 | ||
|
8f35484262 | ||
|
1e3143656d | ||
|
699b1f5012 | ||
|
9c877a621e | ||
|
a3144150e0 | ||
|
c830083df3 | ||
|
9eb03b1bcd | ||
|
7e3136c347 | ||
|
c3de8016c0 | ||
|
af45863f8e | ||
|
08d7d1673e | ||
|
e7c56ccd1e | ||
|
de8cab8e60 | ||
|
9e0f751464 | ||
|
951a429ac5 | ||
|
e43bb9da19 | ||
|
b08bd572ef | ||
|
402ee11273 | ||
|
6e38a26f32 | ||
|
d66239bea8 | ||
|
7eb8df2777 | ||
|
75473fd924 | ||
|
c94ade8ffd | ||
|
61afbd43c9 | ||
|
64f6ea37bd | ||
|
dc0609d153 | ||
|
bd46344a4e | ||
|
7199902316 | ||
|
250873abf2 | ||
|
1e775ecb83 | ||
|
9718c517d9 | ||
|
afc215aa66 | ||
|
5df8157863 | ||
|
802fe6bb29 | ||
|
27d2ad198e | ||
|
63be3ff84c | ||
|
66045bd13d | ||
|
f5f8105b57 | ||
|
4f92ae46ef | ||
|
80f8aa3c7e | ||
|
42778f687b | ||
|
7b27a58b97 | ||
|
a40ba9d350 | ||
|
9ecdff14fa | ||
|
288adc49c9 | ||
|
b8c2428b31 | ||
|
92bfcbafc0 | ||
|
130b5beca2 | ||
|
adb2e0fdd6 | ||
|
0a04bd7f2f | ||
|
9d6af5b314 | ||
|
6efb4b90d4 | ||
|
5806f1728c | ||
|
a9dd527748 | ||
|
db3d20b7b7 | ||
|
acd4e01aaf | ||
|
b217f23ba5 | ||
|
76875af207 | ||
|
f2ba14c309 | ||
|
a65b79a944 | ||
|
681b580fd8 | ||
|
b985b6c377 | ||
|
92eda21e78 | ||
|
0cfdb50477 | ||
|
1eb9a5edd9 | ||
|
383b881748 | ||
|
47543c8fba | ||
|
dc6ed89bfa | ||
|
348dd368b5 | ||
|
40eeefd4f7 | ||
|
47892c17ce | ||
|
f2a369fb73 | ||
|
61dc10ef66 | ||
|
7d01f4d8b1 | ||
|
c7a5e1e290 | ||
|
fbd332dee8 | ||
|
dbf6a12134 | ||
|
dbc47ae383 | ||
|
f22cfd52e0 | ||
|
2a10337344 | ||
|
836eaa62df | ||
|
a01c7adcfb | ||
|
5133faa1ad | ||
|
6a8c2960ad | ||
|
0c98e89fdb | ||
|
5f78181911 | ||
|
03dd1d23fa | ||
|
91683be798 | ||
|
109cb1a562 | ||
|
ad1240e276 | ||
|
2e468d9c8c | ||
|
6caa94b779 | ||
|
429a7eeee3 | ||
|
dec1172f38 | ||
|
afaafb4126 | ||
|
e566fcca08 | ||
|
c7f7ba250c | ||
|
7e3be21811 | ||
|
5e39f1a57c | ||
|
5aa0f44a9b | ||
|
55c767ba7f | ||
|
5502a97f7f | ||
|
8ab1d81917 | ||
|
942543f6a5 | ||
|
a69545a6ae | ||
|
0b13a0c168 | ||
|
d8341ca3b0 | ||
|
34ac314101 | ||
|
02c00f2711 | ||
|
15231c3304 | ||
|
d98e5aef97 | ||
|
5b0dfa471f | ||
|
26481a6553 | ||
|
64e08aa98b | ||
|
0c3168f150 | ||
|
40861c699e | ||
|
d8fee24778 | ||
|
5c617a5947 | ||
|
ff0a3f39d9 | ||
|
bfb4dabf0c | ||
|
58d14ee557 | ||
|
c5182c4bf5 | ||
|
132b016bae | ||
|
4785e95a0c | ||
|
be94a5ef8d | ||
|
208b70a93c | ||
|
6c3155ae3b | ||
|
32f071c2ad | ||
|
fdd1dbe3a9 | ||
|
1ca5bb694d | ||
|
b4cfaa916c | ||
|
fc6c85996e | ||
|
969f055f47 | ||
|
58328d01ef | ||
|
d90914f3dc | ||
|
3a0a86788e | ||
|
a77aa9a41e | ||
|
7217471427 | ||
|
bcc36cc1b2 | ||
|
16052085d0 | ||
|
c20f2864ab | ||
|
4185a44393 | ||
|
c79c5e3c9d | ||
|
35a9f33abb | ||
|
32f128640b | ||
|
18d19af7ec | ||
|
2ee2dd439f | ||
|
5edfb679e7 | ||
|
f45059e1e6 | ||
|
c9384762ee | ||
|
7ea50439ce | ||
|
154e67adbc | ||
|
570a193b7e | ||
|
79e294c927 | ||
|
5d75c7c4c8 | ||
|
7c688cea68 | ||
|
7640cd667f | ||
|
24e2fc95dd | ||
|
ce3f99939f | ||
|
11bc97b16c | ||
|
4804bcd594 | ||
|
ca2c607f90 | ||
|
6c67684fa6 | ||
|
835b2bbae8 | ||
|
47edd2586c | ||
|
ca483cae00 | ||
|
a20bde8444 | ||
|
ac885626b3 | ||
|
976ecc6816 | ||
|
d2f22283bb | ||
|
56b10fc35b | ||
|
5a3ceffba1 | ||
|
b378a685a4 | ||
|
fa50f048f1 | ||
|
f68b50bb4b | ||
|
aad1c3055c | ||
|
cd1dbc3f0f | ||
|
bf4ff0769d | ||
|
a141ebfb50 | ||
|
2fb01daf70 | ||
|
e9e1e084da | ||
|
629e401deb | ||
|
f4c2b6ae63 | ||
|
4487862227 | ||
|
927eca6604 | ||
|
f2612192c5 | ||
|
49bccf47fa | ||
|
fa54167a20 | ||
|
50feb21cb3 | ||
|
52ce5828c9 | ||
|
9cdaedfcb5 | ||
|
adad054cad | ||
|
b2b0c7ee37 | ||
|
488a7c1fe0 | ||
|
85c2e406e4 | ||
|
dcf57d2f7e | ||
|
3fefe9fc49 | ||
|
626a05fb6f | ||
|
ffcd2cfc8a | ||
|
181101c92d | ||
|
3db6804202 | ||
|
3fb135829d | ||
|
2c91e1e7d2 | ||
|
c3982b6c1e | ||
|
ae33c6c19c | ||
|
bcd68b997f | ||
|
fcfa1b9f01 | ||
|
d9a0822517 | ||
|
097e99b699 | ||
|
ff7bec703b | ||
|
c7ab004922 | ||
|
91230ae177 | ||
|
40eba60cf5 | ||
|
fb4cfed20d | ||
|
d3a9a84ac4 | ||
|
accad5366f | ||
|
8eca67e257 | ||
|
40e1bf6ce3 | ||
|
7b89a1dd48 | ||
|
203577724e | ||
|
e3dbef7cbd | ||
|
0ee3303791 | ||
|
83fddd8af6 | ||
|
77c05b5ff6 | ||
|
7c324f058c | ||
|
3db38f2a80 | ||
|
f6b17183c5 | ||
|
8f9d7e243e | ||
|
fde4db9383 | ||
|
3178e3bf15 | ||
|
cdfd05c742 | ||
|
76f6a54327 | ||
|
c91e4b3566 | ||
|
e24561bcef | ||
|
363e941867 | ||
|
3fb2c1888c | ||
|
aa5b296ac7 | ||
|
f2b5d0fef7 | ||
|
0684795a89 | ||
|
2ffc23f400 | ||
|
dc4d16401f | ||
|
849de89a58 | ||
|
f8a2903d02 | ||
|
60977de242 | ||
|
cb612bcfbe | ||
|
6be1c2cdb4 | ||
|
034ab0b3b1 | ||
|
8c50347f3c | ||
|
9f76fb6980 | ||
|
8b0ff0a25c | ||
|
8891ea1a7a | ||
|
ede2ad94bc | ||
|
eacf3cdbb4 | ||
|
3569a13b74 | ||
|
b2a96ec744 | ||
|
a505adb2b7 | ||
|
906b6e52f8 | ||
|
3292337754 | ||
|
eb4af86e3c | ||
|
1b3e971549 | ||
|
4615eee2d8 | ||
|
7c57245943 | ||
|
0d100ad7e9 | ||
|
0235789863 | ||
|
c080a46571 | ||
|
5f050cb590 | ||
|
25f14a1917 | ||
|
e9927377b5 | ||
|
3ea76f8a9b | ||
|
8a45ed9671 | ||
|
1520749351 | ||
|
f66f52d1ba | ||
|
49e18738c3 | ||
|
586b57009a | ||
|
5112564f08 | ||
|
34726a9926 | ||
|
5884ab7b76 | ||
|
60db018ce4 | ||
|
6b002bad3d | ||
|
5b173c1b61 | ||
|
bc2fb5c7ab | ||
|
ebdf82f491 | ||
|
36f6fa9861 | ||
|
91a34bb875 | ||
|
d342fb1879 | ||
|
b283572453 | ||
|
62a74a5ef9 | ||
|
a14aeb27bb | ||
|
249d010dad | ||
|
9b13fdeae4 | ||
|
794b6b35ce | ||
|
dcff4d3db2 | ||
|
b94466e502 | ||
|
11052053d8 | ||
|
6ab3984bba | ||
|
136e0c7e52 | ||
|
7e2ef926ea | ||
|
061981fb23 | ||
|
3d6fb2f2e5 | ||
|
a8e6123d47 | ||
|
406c8a2117 | ||
|
0445962bd4 | ||
|
09f0c2d8ce | ||
|
8dea884a69 | ||
|
57898762a2 | ||
|
01bf8d7b6c | ||
|
af8d55c08e | ||
|
53398b42c6 | ||
|
1bf142e048 | ||
|
0405c4f77d | ||
|
61595763b0 | ||
|
f6ecc8da7b | ||
|
32792a0de5 | ||
|
c3d60b55bd |
@@ -1,9 +1,10 @@
|
|||||||
[cxx]
|
[cxx]
|
||||||
gtest_dep = //lib/gtest:gtest
|
gtest_dep = //lib/gtest:gtest
|
||||||
[android]
|
[android]
|
||||||
target = Google Inc.:Google APIs:19
|
target = android-25
|
||||||
|
build_tools_version = 26.0.2
|
||||||
[ndk]
|
[ndk]
|
||||||
ndk_version = 12.1.2977051
|
ndk_version = 15.2.4203891
|
||||||
compiler = clang
|
compiler = clang
|
||||||
app_platform = android-19
|
app_platform = android-21
|
||||||
cpu_abis = armv7, x86
|
cpu_abis = arm64, armv7, x86, x86_64
|
||||||
|
56
.clang-format
Normal file
56
.clang-format
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
Language: Cpp
|
||||||
|
AccessModifierOffset: -2
|
||||||
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: false
|
||||||
|
AlignTrailingComments: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: false
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: false
|
||||||
|
BinPackParameters: false
|
||||||
|
BreakBeforeBinaryOperators: false
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
BreakStringLiterals: true
|
||||||
|
ColumnLimit: 80
|
||||||
|
CompactNamespaces: false
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentWidth: 2
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 2000
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReflowComments: true
|
||||||
|
SortIncludes: false
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpaceAfterCStyleCast: true
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
Standard: Cpp11
|
||||||
|
UseTab: Never
|
1
.clang-format-ignore
Normal file
1
.clang-format-ignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
^lib/.*
|
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -63,3 +63,5 @@ Carthage/Build
|
|||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
.gradle
|
.gradle
|
||||||
|
# NDK/CMake
|
||||||
|
.externalNativeBuild
|
||||||
|
@@ -1 +1 @@
|
|||||||
3.0
|
4.0
|
||||||
|
163
.travis.yml
163
.travis.yml
@@ -1,120 +1,77 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
language: java
|
||||||
# All rights reserved.
|
os: linux
|
||||||
#
|
dist: trusty
|
||||||
# This source code is licensed under the BSD-style license found in the
|
addons:
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
apt:
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
sources:
|
||||||
|
- llvm-toolchain-trusty-6.0
|
||||||
os: osx
|
- ubuntu-toolchain-r-test
|
||||||
osx_image: xcode8.2
|
packages:
|
||||||
language: cpp
|
- clang-6.0
|
||||||
compiler: clang
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TARGET=c
|
- TARGET: website
|
||||||
- TARGET=java
|
- TARGET: android
|
||||||
- TARGET=net
|
|
||||||
- TARGET=ios
|
install:
|
||||||
- TARGET=js
|
- cd website
|
||||||
- TARGET=android
|
- yarn --ignore-scripts
|
||||||
|
- cd ..
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/buck
|
||||||
|
- $HOME/.gradle
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- brew update > /dev/null
|
|
||||||
- brew tap facebook/fb
|
|
||||||
- brew install buck
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "java" ]]; then
|
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
|
||||||
brew cask install java &&
|
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) &&
|
|
||||||
export PATH=$JAVA_HOME/bin:$PATH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
brew install mono
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
brew outdated xctool || brew upgrade xctool
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Emscripten (used for js tests)
|
|
||||||
# Note: cannot be ran on Linux (because it will compile Clang from its sources :|)
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "js" ]]; then
|
|
||||||
wget -O /tmp/emsdk-portable.tar.gz https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz &&
|
|
||||||
tar xf /tmp/emsdk-portable.tar.gz -C /tmp/ &&
|
|
||||||
/tmp/emsdk_portable/emsdk install latest >& /dev/null &&
|
|
||||||
/tmp/emsdk_portable/emsdk activate latest
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
# Android
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "android" ]]; then
|
if [[ $TARGET = "android" ]]; then
|
||||||
brew cask install java;
|
pushd $HOME
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8);
|
git clone --depth 1 https://github.com/facebook/buck.git
|
||||||
export PATH=$JAVA_HOME/bin:$PATH;
|
cd buck
|
||||||
brew install android-sdk;
|
ant
|
||||||
export ANDROID_SDK=/usr/local/Cellar/android-sdk/24.4.1_1;
|
popd
|
||||||
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1;
|
export PATH=$PATH:$HOME/buck/bin/
|
||||||
brew install lib32stdc++6 lib32z1;
|
buck --version
|
||||||
echo y | $ANDROID_SDK/tools/android update sdk --filter android-19,addon-google_apis-google-19,build-tools-19.1.0 --no-ui;
|
export TERMINAL=dumb
|
||||||
echo y | $ANDROID_SDK/tools/android update sdk -u;
|
source scripts/android-setup.sh && installAndroidSDK
|
||||||
|
export ANDROID_SDK=$ANDROID_HOME
|
||||||
|
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
|
||||||
|
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
|
||||||
fi
|
fi
|
||||||
|
# Website
|
||||||
# JavaScript
|
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "js" ]]; then (
|
if [[ $TARGET = "website" ]]; then
|
||||||
cd javascript &&
|
nvm install 8
|
||||||
npm install &&
|
nvm use 8
|
||||||
unset CC && unset CXX && unset LINK &&
|
fi
|
||||||
source /tmp/emsdk_portable/emsdk_env.sh &&
|
|
||||||
npm run build:browser
|
|
||||||
) fi
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# C
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "c" ]]; then
|
|
||||||
buck test --verbose 0 //:yoga &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark &&
|
|
||||||
git checkout HEAD^ &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "java" ]]; then
|
|
||||||
buck test --verbose 0 //java:java
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
sh csharp/tests/Facebook.Yoga/test_macos.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
buck test --verbose 0 //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "android" ]]; then
|
if [[ $TARGET = "android" ]]; then
|
||||||
buck build --verbose 0 //android/sample:sample
|
./gradlew testDebugUnit && scripts/publish-snapshot.sh
|
||||||
|
fi
|
||||||
|
- |
|
||||||
|
if [[ $TARGET = "website" ]]; then
|
||||||
|
pushd website
|
||||||
|
yarn build
|
||||||
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# JavaScript
|
deploy:
|
||||||
- |
|
provider: pages
|
||||||
if [[ $TARGET = "js" ]]; then (
|
skip-cleanup: true
|
||||||
cd javascript &&
|
github-token: $GITHUB_TOKEN
|
||||||
npm run test:all &&
|
fqdn: yogalayout.com
|
||||||
npm run bench
|
local-dir: website/public
|
||||||
) fi
|
email: yogabot@fb.com
|
||||||
|
name: Yoga-bot
|
||||||
|
keep-history: true
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
condition: $TARGET = website
|
||||||
|
52
BUCK
52
BUCK
@@ -1,46 +1,58 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//tools/build_defs/oss:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "subdir_glob", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
GMOCK_OVERRIDE_FLAGS = [
|
GMOCK_OVERRIDE_FLAGS = [
|
||||||
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
||||||
"-Wno-inconsistent-missing-override",
|
"-Wno-inconsistent-missing-override",
|
||||||
]
|
]
|
||||||
|
|
||||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
|
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
|
||||||
"-std=c11",
|
"-DDEBUG",
|
||||||
"-fPIC",
|
"-DYG_ENABLE_EVENTS",
|
||||||
]
|
]
|
||||||
|
|
||||||
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + ["-std=c++11"]
|
yoga_cxx_library(
|
||||||
|
|
||||||
cxx_library(
|
|
||||||
name = "yoga",
|
name = "yoga",
|
||||||
srcs = glob(["yoga/*.c"]),
|
srcs = glob(["yoga/**/*.cpp"]),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||||
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
public_include_directories = ["."],
|
||||||
header_namespace = "",
|
raw_headers = glob(["yoga/**/*.h"]),
|
||||||
soname = "libyogacore.$(ext)",
|
soname = "libyogacore.$(ext)",
|
||||||
tests = [":YogaTests"],
|
tests = [":YogaTests"],
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [] if THIS_IS_FBOBJC else [
|
deps = [
|
||||||
yoga_dep("lib/fb:ndklog"),
|
yoga_dep("lib/fb:ndklog"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
cxx_test(
|
yoga_cxx_library(
|
||||||
|
name = "yogaForDebug",
|
||||||
|
srcs = glob(["yoga/**/*.cpp"]),
|
||||||
|
compiler_flags = TEST_COMPILER_FLAGS,
|
||||||
|
public_include_directories = ["."],
|
||||||
|
raw_headers = glob(["yoga/**/*.h"]),
|
||||||
|
soname = "libyogacore.$(ext)",
|
||||||
|
tests = [":YogaTests"],
|
||||||
|
visibility = ["PUBLIC"],
|
||||||
|
deps = [
|
||||||
|
":yoga",
|
||||||
|
yoga_dep("lib/fb:ndklog"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
yoga_cxx_test(
|
||||||
name = "YogaTests",
|
name = "YogaTests",
|
||||||
srcs = glob(["tests/*.cpp"]),
|
srcs = glob(["tests/*.cpp"]),
|
||||||
|
headers = subdir_glob([("", "yoga/**/*.h")]),
|
||||||
compiler_flags = TEST_COMPILER_FLAGS,
|
compiler_flags = TEST_COMPILER_FLAGS,
|
||||||
contacts = ["emilsj@fb.com"],
|
contacts = ["emilsj@fb.com"],
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [
|
deps = [
|
||||||
":yoga",
|
":yogaForDebug",
|
||||||
|
yoga_dep("testutil:testutil"),
|
||||||
GTEST_TARGET,
|
GTEST_TARGET,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
24
CMakeLists.txt
Normal file
24
CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.4.1)
|
||||||
|
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||||
|
|
||||||
|
add_compile_options(
|
||||||
|
-fno-omit-frame-pointer
|
||||||
|
-fexceptions
|
||||||
|
-fvisibility=hidden
|
||||||
|
-ffunction-sections
|
||||||
|
-fdata-sections
|
||||||
|
-Wall
|
||||||
|
-std=c++11)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE yogacore_SRC yoga/*.cpp)
|
||||||
|
add_library(yogacore STATIC ${yogacore_SRC})
|
||||||
|
|
||||||
|
target_include_directories(yogacore PUBLIC .)
|
||||||
|
target_link_libraries(yogacore android log)
|
||||||
|
set_target_properties(yogacore PROPERTIES CXX_STANDARD 11)
|
77
CODE_OF_CONDUCT.md
Normal file
77
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to make participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||||
|
level of experience, education, socio-economic status, nationality, personal
|
||||||
|
appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all project spaces, and it also applies when
|
||||||
|
an individual is representing the project or its community in public spaces.
|
||||||
|
Examples of representing a project or community include using an official
|
||||||
|
project e-mail address, posting via an official social media account, or acting
|
||||||
|
as an appointed representative at an online or offline event. Representation of
|
||||||
|
a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at <opensource-conduct@fb.com>. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see
|
||||||
|
https://www.contributor-covenant.org/faq
|
||||||
|
|
@@ -2,6 +2,10 @@
|
|||||||
We want to make contributing to this project as easy and transparent as
|
We want to make contributing to this project as easy and transparent as
|
||||||
possible.
|
possible.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
We actively welcome your pull requests.
|
We actively welcome your pull requests.
|
||||||
1. Fork the repo and create your branch from `master`.
|
1. Fork the repo and create your branch from `master`.
|
||||||
@@ -25,9 +29,6 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
|
|||||||
disclosure of security bugs. In those cases, please go through the process
|
disclosure of security bugs. In those cases, please go through the process
|
||||||
outlined on that page and do not file a public issue.
|
outlined on that page and do not file a public issue.
|
||||||
|
|
||||||
## Coding Style
|
|
||||||
* format.sh
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
By contributing to yoga, you agree that your contributions will be licensed
|
By contributing to yoga, you agree that your contributions will be licensed
|
||||||
under its BSD license.
|
under its MIT license.
|
43
LICENSE
43
LICENSE
@@ -1,30 +1,21 @@
|
|||||||
BSD License
|
MIT License
|
||||||
|
|
||||||
For yoga software
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
|
||||||
Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
The above copyright notice and this permission notice shall be included in all
|
||||||
are permitted provided that the following conditions are met:
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
list of conditions and the following disclaimer.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* Redistributions in binary form must reproduce the above copyright notice,
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
this list of conditions and the following disclaimer in the documentation
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
and/or other materials provided with the distribution.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
* Neither the name Facebook nor the names of its contributors may be used to
|
|
||||||
endorse or promote products derived from this software without specific
|
|
||||||
prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
33
PATENTS
33
PATENTS
@@ -1,33 +0,0 @@
|
|||||||
Additional Grant of Patent Rights Version 2
|
|
||||||
|
|
||||||
"Software" means the yoga software distributed by Facebook, Inc.
|
|
||||||
|
|
||||||
Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software
|
|
||||||
(“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
|
|
||||||
(subject to the termination provision below) license under any Necessary
|
|
||||||
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
|
|
||||||
transfer the Software. For avoidance of doubt, no license is granted under
|
|
||||||
Facebook's rights in any patent claims that are infringed by (i) modifications
|
|
||||||
to the Software made by you or any third party or (ii) the Software in
|
|
||||||
combination with any software or other technology.
|
|
||||||
|
|
||||||
The license granted hereunder will terminate, automatically and without notice,
|
|
||||||
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
|
|
||||||
directly or indirectly, or take a direct financial interest in, any Patent
|
|
||||||
Assertion: (i) against Facebook or any of its subsidiaries or corporate
|
|
||||||
affiliates, (ii) against any party if such Patent Assertion arises in whole or
|
|
||||||
in part from any software, technology, product or service of Facebook or any of
|
|
||||||
its subsidiaries or corporate affiliates, or (iii) against any party relating
|
|
||||||
to the Software. Notwithstanding the foregoing, if Facebook or any of its
|
|
||||||
subsidiaries or corporate affiliates files a lawsuit alleging patent
|
|
||||||
infringement against you in the first instance, and you respond by filing a
|
|
||||||
patent infringement counterclaim in that lawsuit against that party that is
|
|
||||||
unrelated to the Software, the license granted hereunder will not terminate
|
|
||||||
under section (i) of this paragraph due to such counterclaim.
|
|
||||||
|
|
||||||
A "Necessary Claim" is a claim of a patent owned by Facebook that is
|
|
||||||
necessarily infringed by the Software standing alone.
|
|
||||||
|
|
||||||
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
|
|
||||||
or contributory infringement or inducement to infringe any patent, including a
|
|
||||||
cross-claim or counterclaim.
|
|
37
README.md
37
README.md
@@ -1,21 +1,14 @@
|
|||||||
# Yoga [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout)
|
# Yoga [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout) [](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [](https://www.nuget.org/packages/Facebook.Yoga)
|
||||||
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
|
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
|
||||||
|
|
||||||
For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the `tests` directory. Run the tests by executing `buck test //:yoga`.
|
For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the `tests` directory. Run the tests by executing `buck test //:yoga`.
|
||||||
|
|
||||||
Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generated a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following.
|
Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generate a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
|
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
|
||||||
@@ -30,8 +23,26 @@ You may need to install the latest watir-webdriver gem (`gem install watir-webdr
|
|||||||
### .NET
|
### .NET
|
||||||
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
|
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
|
||||||
|
|
||||||
## Code style
|
|
||||||
For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run `bash format.sh` before submitting a pull request. For other languages just try to follow the current code style.
|
|
||||||
|
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
||||||
|
|
||||||
|
### JavaScript
|
||||||
|
Installing through NPM
|
||||||
|
```sh
|
||||||
|
npm install yoga-layout
|
||||||
|
```
|
||||||
|
By default this will install the library and try to build for all platforms (node, browser asm, and standalone webpack). You may receive errors if you do not have the required platform development tools already installed. To preset the platform you'd like to build for you can set a .npmrc property first.
|
||||||
|
```sh
|
||||||
|
npm config set yoga-layout:platform standalone
|
||||||
|
```
|
||||||
|
This will now only run the standalone webpack build upon install.
|
||||||
|
|
||||||
|
## Build Platforms
|
||||||
|
|
||||||
|
| name | description |
|
||||||
|
|----------------|-------------------------------------------------|
|
||||||
|
| all (default) | Builds all of these platforms. |
|
||||||
|
| browser | Builds asm js browser version. |
|
||||||
|
| node | Builds node js version. |
|
||||||
|
| standalone | Runs webpack. |
|
||||||
|
| none | Does nothing. You can use the prepackaged libs. |
|
||||||
|
5212
ReactYoga.xcodeproj/project.pbxproj
Normal file
5212
ReactYoga.xcodeproj/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
42
YOGA_DEFS
42
YOGA_DEFS
@@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
YOGA_ROOT = '//...'
|
|
||||||
JAVA_TARGET = '//java:java'
|
|
||||||
INFER_ANNOTATIONS_TARGET = '//lib/infer-annotations:infer-annotations'
|
|
||||||
JSR_305_TARGET = '//lib/jsr-305:jsr-305'
|
|
||||||
JUNIT_TARGET = '//lib/junit:junit'
|
|
||||||
PROGRUARD_ANNOTATIONS_TARGET = '//java/com/facebook/proguard/annotations:annotations'
|
|
||||||
SOLOADER_TARGET = '//lib/soloader:soloader'
|
|
||||||
GTEST_TARGET = '//lib/gtest:gtest'
|
|
||||||
JNI_TARGET = '//lib/jni:jni'
|
|
||||||
FBJNI_TARGET = '//lib/fb:fbjni'
|
|
||||||
APPCOMPAT_TARGET = '//lib/appcompat:appcompat'
|
|
||||||
ANDROID_SUPPORT_TARGET = '//lib/android-support:android-support'
|
|
||||||
ANDROID_TARGET = '//android:android'
|
|
||||||
ANDROID_JAVA_TARGET = '//android/src/main/java/com/facebook/yoga/android:android'
|
|
||||||
ANDROID_RES_TARGET = '//android:res'
|
|
||||||
ANDROID_SAMPLE_JAVA_TARGET = '//android/sample/java/com/facebook/samples/yoga:yoga'
|
|
||||||
ANDROID_SAMPLE_RES_TARGET = '//android/sample:res'
|
|
||||||
|
|
||||||
THIS_IS_FBOBJC = False
|
|
||||||
|
|
||||||
CXX_LIBRARY_WHITELIST = [
|
|
||||||
'//:yoga',
|
|
||||||
'//lib/fb:fbjni',
|
|
||||||
'//java:jni',
|
|
||||||
]
|
|
||||||
|
|
||||||
BASE_COMPILER_FLAGS = [
|
|
||||||
'-fno-omit-frame-pointer',
|
|
||||||
'-fexceptions',
|
|
||||||
'-Wall',
|
|
||||||
'-Werror',
|
|
||||||
'-O3',
|
|
||||||
]
|
|
||||||
|
|
||||||
def yoga_dep(dep):
|
|
||||||
return '//' + dep
|
|
||||||
|
|
||||||
with allow_unsafe_import():
|
|
||||||
import os.path
|
|
||||||
def isdir(filename):
|
|
||||||
return os.path.isdir(filename)
|
|
26
Yoga.podspec
26
Yoga.podspec
@@ -1,9 +1,14 @@
|
|||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
Pod::Spec.new do |spec|
|
Pod::Spec.new do |spec|
|
||||||
spec.name = 'Yoga'
|
spec.name = 'Yoga'
|
||||||
spec.version = '1.2.0'
|
spec.version = '1.14.0'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://yogalayout.com/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/'
|
spec.documentation_url = 'https://yogalayout.com/docs'
|
||||||
|
|
||||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||||||
@@ -11,18 +16,23 @@ Pod::Spec.new do |spec|
|
|||||||
spec.authors = 'Facebook'
|
spec.authors = 'Facebook'
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.2.0',
|
:tag => spec.version.to_s,
|
||||||
}
|
}
|
||||||
|
spec.platforms = { :ios => "8.0", :osx => "10.7", :tvos => "10.0", :watchos => "2.0" }
|
||||||
spec.module_name = 'yoga'
|
spec.module_name = 'yoga'
|
||||||
spec.requires_arc = false
|
spec.requires_arc = false
|
||||||
|
spec.pod_target_xcconfig = {
|
||||||
|
'DEFINES_MODULE' => 'YES'
|
||||||
|
}
|
||||||
spec.compiler_flags = [
|
spec.compiler_flags = [
|
||||||
'-fno-omit-frame-pointer',
|
'-fno-omit-frame-pointer',
|
||||||
'-fexceptions',
|
'-fexceptions',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Werror',
|
'-Werror',
|
||||||
'-std=c11',
|
'-std=c++1y',
|
||||||
'-fPIC'
|
'-fPIC'
|
||||||
]
|
]
|
||||||
spec.source_files = 'yoga/**/*.{c,h}'
|
spec.source_files = 'yoga/**/*.{c,h,cpp}'
|
||||||
|
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
10
YogaDev.xcworkspace/contents.xcworkspacedata
generated
Normal file
10
YogaDev.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:YogaDev/YogaDev.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:ReactYoga.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
350
YogaDev/YogaDev.xcodeproj/project.pbxproj
Normal file
350
YogaDev/YogaDev.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 50;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
6D4C7FA42249476900CBB1EC /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F892249476700CBB1EC /* YGMarker.cpp */; };
|
||||||
|
6D4C7FA52249476900CBB1EC /* YGValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F8B2249476700CBB1EC /* YGValue.cpp */; };
|
||||||
|
6D4C7FA62249476900CBB1EC /* YGLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F902249476700CBB1EC /* YGLayout.cpp */; };
|
||||||
|
6D4C7FA72249476900CBB1EC /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F922249476700CBB1EC /* YGNodePrint.cpp */; };
|
||||||
|
6D4C7FA82249476900CBB1EC /* YGStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F992249476800CBB1EC /* YGStyle.cpp */; };
|
||||||
|
6D4C7FA92249476900CBB1EC /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F9A2249476800CBB1EC /* log.cpp */; };
|
||||||
|
6D4C7FAA2249476900CBB1EC /* YGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F9B2249476800CBB1EC /* YGNode.cpp */; };
|
||||||
|
6D4C7FAB2249476900CBB1EC /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F9C2249476800CBB1EC /* Yoga.cpp */; };
|
||||||
|
6D4C7FAC2249476900CBB1EC /* Utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F9D2249476800CBB1EC /* Utils.cpp */; };
|
||||||
|
6D4C7FAD2249476900CBB1EC /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7F9E2249476800CBB1EC /* YGEnums.cpp */; };
|
||||||
|
6D4C7FAE2249476900CBB1EC /* YGConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D4C7FA32249476800CBB1EC /* YGConfig.cpp */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
6D4C7F76224945B200CBB1EC /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "include/$(PRODUCT_NAME)";
|
||||||
|
dstSubfolderSpec = 16;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
6D4C7F78224945B200CBB1EC /* libYogaDev.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libYogaDev.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
6D4C7F892249476700CBB1EC /* YGMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGMarker.cpp; path = ../yoga/YGMarker.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8A2249476700CBB1EC /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utils.h; path = ../yoga/Utils.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8B2249476700CBB1EC /* YGValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGValue.cpp; path = ../yoga/YGValue.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8C2249476700CBB1EC /* instrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = instrumentation.h; path = ../yoga/instrumentation.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8D2249476700CBB1EC /* YGStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGStyle.h; path = ../yoga/YGStyle.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8E2249476700CBB1EC /* YGNodePrint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGNodePrint.h; path = ../yoga/YGNodePrint.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F8F2249476700CBB1EC /* YGMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGMarker.h; path = ../yoga/YGMarker.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F902249476700CBB1EC /* YGLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGLayout.cpp; path = ../yoga/YGLayout.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F912249476700CBB1EC /* YGEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGEnums.h; path = ../yoga/YGEnums.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F922249476700CBB1EC /* YGNodePrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGNodePrint.cpp; path = ../yoga/YGNodePrint.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F932249476700CBB1EC /* YGMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGMacros.h; path = ../yoga/YGMacros.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F942249476700CBB1EC /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = log.h; path = ../yoga/log.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F952249476800CBB1EC /* YGFloatOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGFloatOptional.h; path = ../yoga/YGFloatOptional.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F962249476800CBB1EC /* YGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGNode.h; path = ../yoga/YGNode.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F972249476800CBB1EC /* YGLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGLayout.h; path = ../yoga/YGLayout.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F982249476800CBB1EC /* CompactValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompactValue.h; path = ../yoga/CompactValue.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7F992249476800CBB1EC /* YGStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGStyle.cpp; path = ../yoga/YGStyle.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9A2249476800CBB1EC /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = log.cpp; path = ../yoga/log.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9B2249476800CBB1EC /* YGNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGNode.cpp; path = ../yoga/YGNode.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9C2249476800CBB1EC /* Yoga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Yoga.cpp; path = ../yoga/Yoga.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9D2249476800CBB1EC /* Utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Utils.cpp; path = ../yoga/Utils.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9E2249476800CBB1EC /* YGEnums.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGEnums.cpp; path = ../yoga/YGEnums.cpp; sourceTree = "<group>"; };
|
||||||
|
6D4C7F9F2249476800CBB1EC /* Yoga-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Yoga-internal.h"; path = "../yoga/Yoga-internal.h"; sourceTree = "<group>"; };
|
||||||
|
6D4C7FA02249476800CBB1EC /* YGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGValue.h; path = ../yoga/YGValue.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7FA12249476800CBB1EC /* Yoga.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Yoga.h; path = ../yoga/Yoga.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7FA22249476800CBB1EC /* YGConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YGConfig.h; path = ../yoga/YGConfig.h; sourceTree = "<group>"; };
|
||||||
|
6D4C7FA32249476800CBB1EC /* YGConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YGConfig.cpp; path = ../yoga/YGConfig.cpp; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
6D4C7F75224945B200CBB1EC /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
6D4C7F6F224945B200CBB1EC = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
6D4C7F982249476800CBB1EC /* CompactValue.h */,
|
||||||
|
6D4C7F8C2249476700CBB1EC /* instrumentation.h */,
|
||||||
|
6D4C7F9A2249476800CBB1EC /* log.cpp */,
|
||||||
|
6D4C7F942249476700CBB1EC /* log.h */,
|
||||||
|
6D4C7F9D2249476800CBB1EC /* Utils.cpp */,
|
||||||
|
6D4C7F8A2249476700CBB1EC /* Utils.h */,
|
||||||
|
6D4C7FA32249476800CBB1EC /* YGConfig.cpp */,
|
||||||
|
6D4C7FA22249476800CBB1EC /* YGConfig.h */,
|
||||||
|
6D4C7F9E2249476800CBB1EC /* YGEnums.cpp */,
|
||||||
|
6D4C7F912249476700CBB1EC /* YGEnums.h */,
|
||||||
|
6D4C7F952249476800CBB1EC /* YGFloatOptional.h */,
|
||||||
|
6D4C7F902249476700CBB1EC /* YGLayout.cpp */,
|
||||||
|
6D4C7F972249476800CBB1EC /* YGLayout.h */,
|
||||||
|
6D4C7F932249476700CBB1EC /* YGMacros.h */,
|
||||||
|
6D4C7F892249476700CBB1EC /* YGMarker.cpp */,
|
||||||
|
6D4C7F8F2249476700CBB1EC /* YGMarker.h */,
|
||||||
|
6D4C7F9B2249476800CBB1EC /* YGNode.cpp */,
|
||||||
|
6D4C7F962249476800CBB1EC /* YGNode.h */,
|
||||||
|
6D4C7F922249476700CBB1EC /* YGNodePrint.cpp */,
|
||||||
|
6D4C7F8E2249476700CBB1EC /* YGNodePrint.h */,
|
||||||
|
6D4C7F992249476800CBB1EC /* YGStyle.cpp */,
|
||||||
|
6D4C7F8D2249476700CBB1EC /* YGStyle.h */,
|
||||||
|
6D4C7F8B2249476700CBB1EC /* YGValue.cpp */,
|
||||||
|
6D4C7FA02249476800CBB1EC /* YGValue.h */,
|
||||||
|
6D4C7F9F2249476800CBB1EC /* Yoga-internal.h */,
|
||||||
|
6D4C7F9C2249476800CBB1EC /* Yoga.cpp */,
|
||||||
|
6D4C7FA12249476800CBB1EC /* Yoga.h */,
|
||||||
|
6D4C7F79224945B200CBB1EC /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
6D4C7F79224945B200CBB1EC /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
6D4C7F78224945B200CBB1EC /* libYogaDev.a */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
6D4C7F77224945B200CBB1EC /* YogaDev */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 6D4C7F81224945B200CBB1EC /* Build configuration list for PBXNativeTarget "YogaDev" */;
|
||||||
|
buildPhases = (
|
||||||
|
6D4C7F74224945B200CBB1EC /* Sources */,
|
||||||
|
6D4C7F75224945B200CBB1EC /* Frameworks */,
|
||||||
|
6D4C7F76224945B200CBB1EC /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = YogaDev;
|
||||||
|
productName = YogaDev;
|
||||||
|
productReference = 6D4C7F78224945B200CBB1EC /* libYogaDev.a */;
|
||||||
|
productType = "com.apple.product-type.library.static";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
6D4C7F70224945B200CBB1EC /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 1010;
|
||||||
|
ORGANIZATIONNAME = "Will Wilson";
|
||||||
|
TargetAttributes = {
|
||||||
|
6D4C7F77224945B200CBB1EC = {
|
||||||
|
CreatedOnToolsVersion = 10.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 6D4C7F73224945B200CBB1EC /* Build configuration list for PBXProject "YogaDev" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
);
|
||||||
|
mainGroup = 6D4C7F6F224945B200CBB1EC;
|
||||||
|
productRefGroup = 6D4C7F79224945B200CBB1EC /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
6D4C7F77224945B200CBB1EC /* YogaDev */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
6D4C7F74224945B200CBB1EC /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
6D4C7FAD2249476900CBB1EC /* YGEnums.cpp in Sources */,
|
||||||
|
6D4C7FAE2249476900CBB1EC /* YGConfig.cpp in Sources */,
|
||||||
|
6D4C7FAA2249476900CBB1EC /* YGNode.cpp in Sources */,
|
||||||
|
6D4C7FAB2249476900CBB1EC /* Yoga.cpp in Sources */,
|
||||||
|
6D4C7FA92249476900CBB1EC /* log.cpp in Sources */,
|
||||||
|
6D4C7FA62249476900CBB1EC /* YGLayout.cpp in Sources */,
|
||||||
|
6D4C7FAC2249476900CBB1EC /* Utils.cpp in Sources */,
|
||||||
|
6D4C7FA82249476900CBB1EC /* YGStyle.cpp in Sources */,
|
||||||
|
6D4C7FA42249476900CBB1EC /* YGMarker.cpp in Sources */,
|
||||||
|
6D4C7FA52249476900CBB1EC /* YGValue.cpp in Sources */,
|
||||||
|
6D4C7FA72249476900CBB1EC /* YGNodePrint.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
6D4C7F7F224945B200CBB1EC /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
6D4C7F80224945B200CBB1EC /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
6D4C7F82224945B200CBB1EC /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
6D4C7F83224945B200CBB1EC /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
6D4C7F73224945B200CBB1EC /* Build configuration list for PBXProject "YogaDev" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
6D4C7F7F224945B200CBB1EC /* Debug */,
|
||||||
|
6D4C7F80224945B200CBB1EC /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
6D4C7F81224945B200CBB1EC /* Build configuration list for PBXNativeTarget "YogaDev" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
6D4C7F82224945B200CBB1EC /* Debug */,
|
||||||
|
6D4C7F83224945B200CBB1EC /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 6D4C7F70224945B200CBB1EC /* Project object */;
|
||||||
|
}
|
@@ -1,9 +1,14 @@
|
|||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
podspec = Pod::Spec.new do |spec|
|
podspec = Pod::Spec.new do |spec|
|
||||||
spec.name = 'YogaKit'
|
spec.name = 'YogaKit'
|
||||||
spec.version = '1.2.0'
|
spec.version = '1.17.0'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://facebook.github.io/yoga/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
|
spec.documentation_url = 'https://facebook.github.io/yoga/docs/'
|
||||||
|
|
||||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||||||
@@ -11,17 +16,26 @@ podspec = Pod::Spec.new do |spec|
|
|||||||
spec.authors = 'Facebook'
|
spec.authors = 'Facebook'
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.2.0',
|
:tag => spec.version.to_s,
|
||||||
}
|
}
|
||||||
|
|
||||||
spec.platform = :ios
|
spec.platform = :ios
|
||||||
spec.ios.deployment_target = '8.0'
|
spec.ios.deployment_target = '8.0'
|
||||||
spec.ios.frameworks = 'UIKit'
|
spec.ios.frameworks = 'UIKit'
|
||||||
|
spec.default_subspec = "Core"
|
||||||
|
spec.dependency 'Yoga', '~> 1.14'
|
||||||
|
spec.module_name = 'YogaKit'
|
||||||
|
|
||||||
|
spec.subspec "Core" do |ss|
|
||||||
|
ss.source_files = 'YogaKit/Source/*.{h,m}'
|
||||||
|
ss.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
||||||
|
ss.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
||||||
|
end
|
||||||
|
|
||||||
|
spec.subspec 'SwiftExtension' do |ss|
|
||||||
|
ss.source_files = 'YogaKit/Source/*.{swift}'
|
||||||
|
end
|
||||||
|
|
||||||
spec.dependency 'Yoga', '~> 1.2'
|
|
||||||
spec.source_files = 'YogaKit/Source/*.{h,m}'
|
|
||||||
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
|
||||||
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# See https://github.com/facebook/yoga/pull/366
|
# See https://github.com/facebook/yoga/pull/366
|
||||||
|
26
YogaKit/BUCK
26
YogaKit/BUCK
@@ -1,11 +1,8 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_apple_library", "yoga_apple_test", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
COMPILER_FLAGS = [
|
COMPILER_FLAGS = [
|
||||||
"-fobjc-arc",
|
"-fobjc-arc",
|
||||||
@@ -27,22 +24,31 @@ COMPILER_FLAGS = [
|
|||||||
"-Wunused-value",
|
"-Wunused-value",
|
||||||
]
|
]
|
||||||
|
|
||||||
apple_library(
|
yoga_apple_library(
|
||||||
name = "YogaKit",
|
name = "YogaKit",
|
||||||
srcs = glob(["Source/**/*.m"]),
|
srcs = glob(["Source/**/*.m"]),
|
||||||
|
header_namespace = "",
|
||||||
|
exported_headers = subdir_glob(
|
||||||
|
[
|
||||||
|
("", "Source/**/*.h"),
|
||||||
|
("Source", "**/*.h"),
|
||||||
|
],
|
||||||
|
prefix = "YogaKit",
|
||||||
|
),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
exported_headers = glob(["Source/**/*.h"]),
|
|
||||||
frameworks = [
|
frameworks = [
|
||||||
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
||||||
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
||||||
],
|
],
|
||||||
|
header_path_prefix = "",
|
||||||
|
link_whole = True,
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [
|
deps = [
|
||||||
yoga_dep(":yoga"),
|
yoga_dep(":yoga"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
apple_test(
|
yoga_apple_test(
|
||||||
name = "YogaKitTests",
|
name = "YogaKitTests",
|
||||||
srcs = glob(["Tests/**/*.m"]),
|
srcs = glob(["Tests/**/*.m"]),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
|
@@ -1,46 +0,0 @@
|
|||||||
# CHANGELOG
|
|
||||||
|
|
||||||
The changelog for `YogaKit`.
|
|
||||||
|
|
||||||
1.2.0 (**upcoming release**)
|
|
||||||
-----
|
|
||||||
|
|
||||||
### Breaking Changes
|
|
||||||
|
|
||||||
- `applyLayout()` has now been changed to `applyLayout(preservingOrigin:)`.
|
|
||||||
|
|
||||||
- Computed properties are no longer reflected in getter's of the affected properties.
|
|
||||||
```swift
|
|
||||||
// OLD
|
|
||||||
view.yoga.margin = 10
|
|
||||||
view.yoga.marginTop // 10
|
|
||||||
view.yoga.marginLeft // 10
|
|
||||||
|
|
||||||
// NEW
|
|
||||||
view.yoga.margin = 10
|
|
||||||
view.yoga.marginTop // 0
|
|
||||||
view.yoga.marginLeft // 0
|
|
||||||
```
|
|
||||||
|
|
||||||
### Enhancements
|
|
||||||
|
|
||||||
- Pixel Rounding now uses `roundf()` instead of `round()`.
|
|
||||||
|
|
||||||
- There is now a method that allows "bulk" updates to YGLayout.
|
|
||||||
```objc
|
|
||||||
[view configureLayoutWithBlock:^(YGLayout *layout) {
|
|
||||||
layout.isEnabled = YES;
|
|
||||||
layout.width = 50;
|
|
||||||
layout.height = 50;
|
|
||||||
}];
|
|
||||||
```
|
|
||||||
|
|
||||||
```swift
|
|
||||||
view.configureLayout { (layout) in
|
|
||||||
layout.isEnabled = true
|
|
||||||
layout.width = 50
|
|
||||||
layout.height = 50
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- Added new `isDirty` property, and make `markDirty` a little more performant.
|
|
@@ -8,7 +8,7 @@
|
|||||||
YogaKit is available to install via [CocoaPods](https://cocoapods.org/).
|
YogaKit is available to install via [CocoaPods](https://cocoapods.org/).
|
||||||
|
|
||||||
```
|
```
|
||||||
pod 'YogaKit', '~> 1.1'
|
pod 'YogaKit', '~> 1.7'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
@@ -19,4 +19,4 @@ We also have a sample project. To try it out, clone this repo and open `YogaKitS
|
|||||||
## Contributing
|
## Contributing
|
||||||
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
|
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
|
||||||
|
|
||||||
See the [CONTRIBUTING](https://github.com/facebook/yoga/blob/master/CONTRIBUTING) file for how to help out.
|
See the [CONTRIBUTING.md](https://github.com/facebook/yoga/blob/master/CONTRIBUTING.md) file for how to help out.
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
#import "YGLayout.h"
|
||||||
@@ -12,7 +10,7 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
typedef void (^YGLayoutConfigurationBlock)(YGLayout *);
|
typedef void (^YGLayoutConfigurationBlock)(YGLayout *layout);
|
||||||
|
|
||||||
@interface UIView (Yoga)
|
@interface UIView (Yoga)
|
||||||
|
|
||||||
@@ -20,6 +18,10 @@ typedef void (^YGLayoutConfigurationBlock)(YGLayout *);
|
|||||||
The YGLayout that is attached to this view. It is lazily created.
|
The YGLayout that is attached to this view. It is lazily created.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, strong) YGLayout *yoga;
|
@property (nonatomic, readonly, strong) YGLayout *yoga;
|
||||||
|
/**
|
||||||
|
Indicates whether or not Yoga is enabled
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly, assign) BOOL isYogaEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
In ObjC land, every time you access `view.yoga.*` you are adding another `objc_msgSend`
|
In ObjC land, every time you access `view.yoga.*` you are adding another `objc_msgSend`
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "UIView+Yoga.h"
|
#import "UIView+Yoga.h"
|
||||||
@@ -26,6 +24,11 @@ static const void *kYGYogaAssociatedKey = &kYGYogaAssociatedKey;
|
|||||||
return yoga;
|
return yoga;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isYogaEnabled
|
||||||
|
{
|
||||||
|
return objc_getAssociatedObject(self, kYGYogaAssociatedKey) != nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
||||||
{
|
{
|
||||||
if (block != nil) {
|
if (block != nil) {
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
#import "YGLayout.h"
|
||||||
|
@@ -1,19 +1,48 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import <yoga/YGEnums.h>
|
#import <yoga/YGEnums.h>
|
||||||
|
#import <yoga/Yoga.h>
|
||||||
|
#import <yoga/YGMacros.h>
|
||||||
|
|
||||||
|
YG_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
extern YGValue YGPointValue(CGFloat value)
|
||||||
|
NS_SWIFT_UNAVAILABLE("Use the swift Int and FloatingPoint extensions instead");
|
||||||
|
extern YGValue YGPercentValue(CGFloat value)
|
||||||
|
NS_SWIFT_UNAVAILABLE("Use the swift Int and FloatingPoint extensions instead");
|
||||||
|
|
||||||
|
YG_EXTERN_C_END
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
||||||
|
YGDimensionFlexibilityFlexibleWidth = 1 << 0,
|
||||||
|
YGDimensionFlexibilityFlexibleHeight = 1 << 1,
|
||||||
|
};
|
||||||
|
|
||||||
@interface YGLayout : NSObject
|
@interface YGLayout : NSObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The property that decides if we should include this view when calculating layout. Defaults to YES.
|
Make default init unavailable, as it will not initialise YGNode which is
|
||||||
|
required for the setters and getters of YGLayout's properties to work properly.
|
||||||
|
*/
|
||||||
|
- (instancetype)init
|
||||||
|
__attribute__((unavailable("you are not meant to initialise YGLayout")));
|
||||||
|
|
||||||
|
/**
|
||||||
|
Make default init unavailable, as it will not initialise YGNode which is
|
||||||
|
required for the setters and getters of YGLayout's properties to work properly.
|
||||||
|
*/
|
||||||
|
+ (instancetype)new
|
||||||
|
__attribute__((unavailable("you are not meant to initialise YGLayout")));
|
||||||
|
|
||||||
|
/**
|
||||||
|
The property that decides if we should include this view when calculating
|
||||||
|
layout. Defaults to YES.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
||||||
|
|
||||||
@@ -34,36 +63,37 @@
|
|||||||
@property (nonatomic, readwrite, assign) YGOverflow overflow;
|
@property (nonatomic, readwrite, assign) YGOverflow overflow;
|
||||||
@property (nonatomic, readwrite, assign) YGDisplay display;
|
@property (nonatomic, readwrite, assign) YGDisplay display;
|
||||||
|
|
||||||
|
@property (nonatomic, readwrite, assign) CGFloat flex;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat flexGrow;
|
@property (nonatomic, readwrite, assign) CGFloat flexGrow;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat flexShrink;
|
@property (nonatomic, readwrite, assign) CGFloat flexShrink;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat flexBasis;
|
@property (nonatomic, readwrite, assign) YGValue flexBasis;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat left;
|
@property (nonatomic, readwrite, assign) YGValue left;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat top;
|
@property (nonatomic, readwrite, assign) YGValue top;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat right;
|
@property (nonatomic, readwrite, assign) YGValue right;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat bottom;
|
@property (nonatomic, readwrite, assign) YGValue bottom;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat start;
|
@property (nonatomic, readwrite, assign) YGValue start;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat end;
|
@property (nonatomic, readwrite, assign) YGValue end;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginLeft;
|
@property (nonatomic, readwrite, assign) YGValue marginLeft;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginTop;
|
@property (nonatomic, readwrite, assign) YGValue marginTop;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginRight;
|
@property (nonatomic, readwrite, assign) YGValue marginRight;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginBottom;
|
@property (nonatomic, readwrite, assign) YGValue marginBottom;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginStart;
|
@property (nonatomic, readwrite, assign) YGValue marginStart;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginEnd;
|
@property (nonatomic, readwrite, assign) YGValue marginEnd;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginHorizontal;
|
@property (nonatomic, readwrite, assign) YGValue marginHorizontal;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat marginVertical;
|
@property (nonatomic, readwrite, assign) YGValue marginVertical;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat margin;
|
@property (nonatomic, readwrite, assign) YGValue margin;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingLeft;
|
@property (nonatomic, readwrite, assign) YGValue paddingLeft;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingTop;
|
@property (nonatomic, readwrite, assign) YGValue paddingTop;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingRight;
|
@property (nonatomic, readwrite, assign) YGValue paddingRight;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingBottom;
|
@property (nonatomic, readwrite, assign) YGValue paddingBottom;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingStart;
|
@property (nonatomic, readwrite, assign) YGValue paddingStart;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingEnd;
|
@property (nonatomic, readwrite, assign) YGValue paddingEnd;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingHorizontal;
|
@property (nonatomic, readwrite, assign) YGValue paddingHorizontal;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat paddingVertical;
|
@property (nonatomic, readwrite, assign) YGValue paddingVertical;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat padding;
|
@property (nonatomic, readwrite, assign) YGValue padding;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderLeftWidth;
|
@property (nonatomic, readwrite, assign) CGFloat borderLeftWidth;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderTopWidth;
|
@property (nonatomic, readwrite, assign) CGFloat borderTopWidth;
|
||||||
@@ -73,12 +103,12 @@
|
|||||||
@property (nonatomic, readwrite, assign) CGFloat borderEndWidth;
|
@property (nonatomic, readwrite, assign) CGFloat borderEndWidth;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat borderWidth;
|
@property (nonatomic, readwrite, assign) CGFloat borderWidth;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) CGFloat width;
|
@property (nonatomic, readwrite, assign) YGValue width;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat height;
|
@property (nonatomic, readwrite, assign) YGValue height;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat minWidth;
|
@property (nonatomic, readwrite, assign) YGValue minWidth;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat minHeight;
|
@property (nonatomic, readwrite, assign) YGValue minHeight;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat maxWidth;
|
@property (nonatomic, readwrite, assign) YGValue maxWidth;
|
||||||
@property (nonatomic, readwrite, assign) CGFloat maxHeight;
|
@property (nonatomic, readwrite, assign) YGValue maxHeight;
|
||||||
|
|
||||||
// Yoga specific properties, not compatible with flexbox specification
|
// Yoga specific properties, not compatible with flexbox specification
|
||||||
@property (nonatomic, readwrite, assign) CGFloat aspectRatio;
|
@property (nonatomic, readwrite, assign) CGFloat aspectRatio;
|
||||||
@@ -95,12 +125,26 @@
|
|||||||
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
||||||
NS_SWIFT_NAME(applyLayout(preservingOrigin:));
|
NS_SWIFT_NAME(applyLayout(preservingOrigin:));
|
||||||
|
|
||||||
|
/**
|
||||||
|
Perform a layout calculation and update the frames of the views in the hierarchy with the results.
|
||||||
|
If the origin is not preserved, the root view's layout results will applied from {0,0}.
|
||||||
|
*/
|
||||||
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin
|
||||||
|
dimensionFlexibility:(YGDimensionFlexibility)dimensionFlexibility
|
||||||
|
NS_SWIFT_NAME(applyLayout(preservingOrigin:dimensionFlexibility:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self
|
Returns the size of the view if no constraints were given. This could equivalent to calling [self
|
||||||
sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the size of the view based on provided constraints. Pass NaN for an unconstrained dimension.
|
||||||
|
*/
|
||||||
|
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
||||||
|
NS_SWIFT_NAME(calculateLayout(with:));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the number of children that are using Flexbox.
|
Returns the number of children that are using Flexbox.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout+Private.h"
|
#import "YGLayout+Private.h"
|
||||||
@@ -21,26 +19,56 @@
|
|||||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
#define YG_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||||
- (CGFloat)lowercased_name \
|
- (YGValue)lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
YGValue value = YGNodeStyleGet##capitalized_name(self.node); \
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
if (value.unit == YGUnitPoint) { \
|
} \
|
||||||
return value.value; \
|
\
|
||||||
} else { \
|
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
||||||
return YGUndefined; \
|
{ \
|
||||||
} \
|
switch (lowercased_name.unit) { \
|
||||||
} \
|
case YGUnitUndefined: \
|
||||||
\
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
- (void)set##capitalized_name:(CGFloat)lowercased_name \
|
break; \
|
||||||
{ \
|
case YGUnitPoint: \
|
||||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPercent: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Percent(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
NSAssert(NO, @"Not implemented"); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
#define YG_AUTO_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||||
- (CGFloat)lowercased_name \
|
- (YGValue)lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
return YGNodeStyleGet##property(self.node, edge); \
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
||||||
|
{ \
|
||||||
|
switch (lowercased_name.unit) { \
|
||||||
|
case YGUnitPoint: \
|
||||||
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPercent: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Percent(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitAuto: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Auto(self.node); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
NSAssert(NO, @"Not implemented"); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define YG_EDGE_PROPERTY_GETTER(type, lowercased_name, capitalized_name, property, edge) \
|
||||||
|
- (type)lowercased_name \
|
||||||
|
{ \
|
||||||
|
return YGNodeStyleGet##property(self.node, edge); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge) \
|
||||||
@@ -49,47 +77,59 @@
|
|||||||
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||||
YG_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
YG_EDGE_PROPERTY_GETTER(CGFloat, lowercased_name, capitalized_name, property, edge) \
|
||||||
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||||
|
|
||||||
#define YG_VALUE_EDGE_PROPERTY_GETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
#define YG_VALUE_EDGE_PROPERTY_SETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
||||||
- (CGFloat)objc_lowercased_name \
|
- (void)set##objc_capitalized_name:(YGValue)objc_lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
YGValue value = YGNodeStyleGet##c_name(self.node, edge); \
|
switch (objc_lowercased_name.unit) { \
|
||||||
if (value.unit == YGUnitPoint) { \
|
case YGUnitUndefined: \
|
||||||
return value.value; \
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
} else { \
|
break; \
|
||||||
return YGUndefined; \
|
case YGUnitPoint: \
|
||||||
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPercent: \
|
||||||
|
YGNodeStyleSet##c_name##Percent(self.node, edge, objc_lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
NSAssert(NO, @"Not implemented"); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_VALUE_EDGE_PROPERTY_SETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
#define YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||||
- (void)set##objc_capitalized_name:(CGFloat)objc_lowercased_name \
|
YG_EDGE_PROPERTY_GETTER(YGValue, lowercased_name, capitalized_name, property, edge) \
|
||||||
{ \
|
|
||||||
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
|
||||||
YG_VALUE_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
|
||||||
YG_VALUE_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
YG_VALUE_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||||
|
|
||||||
#define YG_VALUE_EDGES_PROPERTIES(lowercased_name, capitalized_name) \
|
#define YG_VALUE_EDGES_PROPERTIES(lowercased_name, capitalized_name) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Left, capitalized_name##Left, capitalized_name, YGEdgeLeft) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Left, capitalized_name##Left, capitalized_name, YGEdgeLeft) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Top, capitalized_name##Top, capitalized_name, YGEdgeTop) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Top, capitalized_name##Top, capitalized_name, YGEdgeTop) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Right, capitalized_name##Right, capitalized_name, YGEdgeRight) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Right, capitalized_name##Right, capitalized_name, YGEdgeRight) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Bottom, capitalized_name##Bottom, capitalized_name, YGEdgeBottom) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Bottom, capitalized_name##Bottom, capitalized_name, YGEdgeBottom) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Start, capitalized_name##Start, capitalized_name, YGEdgeStart) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Start, capitalized_name##Start, capitalized_name, YGEdgeStart) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##End, capitalized_name##End, capitalized_name, YGEdgeEnd) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##End, capitalized_name##End, capitalized_name, YGEdgeEnd) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Horizontal, capitalized_name##Horizontal, capitalized_name, YGEdgeHorizontal) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Horizontal, capitalized_name##Horizontal, capitalized_name, YGEdgeHorizontal) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Vertical, capitalized_name##Vertical, capitalized_name, YGEdgeVertical) \
|
YG_VALUE_EDGE_PROPERTY(lowercased_name##Vertical, capitalized_name##Vertical, capitalized_name, YGEdgeVertical) \
|
||||||
YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
|
YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
|
||||||
|
|
||||||
|
YGValue YGPointValue(CGFloat value)
|
||||||
|
{
|
||||||
|
return (YGValue) { .value = value, .unit = YGUnitPoint };
|
||||||
|
}
|
||||||
|
|
||||||
|
YGValue YGPercentValue(CGFloat value)
|
||||||
|
{
|
||||||
|
return (YGValue) { .value = value, .unit = YGUnitPercent };
|
||||||
|
}
|
||||||
|
|
||||||
static YGConfigRef globalConfig;
|
static YGConfigRef globalConfig;
|
||||||
|
|
||||||
@interface YGLayout ()
|
@interface YGLayout ()
|
||||||
|
|
||||||
@property (nonatomic, weak, readonly) UIView *view;
|
@property (nonatomic, weak, readonly) UIView *view;
|
||||||
|
@property(nonatomic, assign, readonly) BOOL isUIView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -103,6 +143,7 @@ static YGConfigRef globalConfig;
|
|||||||
{
|
{
|
||||||
globalConfig = YGConfigNew();
|
globalConfig = YGConfigNew();
|
||||||
YGConfigSetExperimentalFeatureEnabled(globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
YGConfigSetExperimentalFeatureEnabled(globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
||||||
|
YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithView:(UIView*)view
|
- (instancetype)initWithView:(UIView*)view
|
||||||
@@ -113,6 +154,7 @@ static YGConfigRef globalConfig;
|
|||||||
YGNodeSetContext(_node, (__bridge void *) view);
|
YGNodeSetContext(_node, (__bridge void *) view);
|
||||||
_isEnabled = NO;
|
_isEnabled = NO;
|
||||||
_isIncludedInLayout = YES;
|
_isIncludedInLayout = YES;
|
||||||
|
_isUIView = [view isMemberOfClass:[UIView class]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@@ -138,7 +180,7 @@ static YGConfigRef globalConfig;
|
|||||||
// the measure function. Since we already know that this is a leaf,
|
// the measure function. Since we already know that this is a leaf,
|
||||||
// this *should* be fine. Forgive me Hack Gods.
|
// this *should* be fine. Forgive me Hack Gods.
|
||||||
const YGNodeRef node = self.node;
|
const YGNodeRef node = self.node;
|
||||||
if (YGNodeGetMeasureFunc(node) == NULL) {
|
if (!YGNodeHasMeasureFunc(node)) {
|
||||||
YGNodeSetMeasureFunc(node, YGMeasureView);
|
YGNodeSetMeasureFunc(node, YGMeasureView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,9 +229,10 @@ YG_PROPERTY(YGWrap, flexWrap, FlexWrap)
|
|||||||
YG_PROPERTY(YGOverflow, overflow, Overflow)
|
YG_PROPERTY(YGOverflow, overflow, Overflow)
|
||||||
YG_PROPERTY(YGDisplay, display, Display)
|
YG_PROPERTY(YGDisplay, display, Display)
|
||||||
|
|
||||||
|
YG_PROPERTY(CGFloat, flex, Flex)
|
||||||
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
||||||
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
||||||
YG_VALUE_PROPERTY(flexBasis, FlexBasis)
|
YG_AUTO_VALUE_PROPERTY(flexBasis, FlexBasis)
|
||||||
|
|
||||||
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
||||||
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
||||||
@@ -208,8 +251,8 @@ YG_EDGE_PROPERTY(borderStartWidth, BorderStartWidth, Border, YGEdgeStart)
|
|||||||
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
||||||
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
||||||
|
|
||||||
YG_VALUE_PROPERTY(width, Width)
|
YG_AUTO_VALUE_PROPERTY(width, Width)
|
||||||
YG_VALUE_PROPERTY(height, Height)
|
YG_AUTO_VALUE_PROPERTY(height, Height)
|
||||||
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
||||||
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
||||||
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
||||||
@@ -235,6 +278,20 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin dimensionFlexibility:(YGDimensionFlexibility)dimensionFlexibility
|
||||||
|
{
|
||||||
|
CGSize size = self.view.bounds.size;
|
||||||
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) {
|
||||||
|
size.width = YGUndefined;
|
||||||
|
}
|
||||||
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleHeight) {
|
||||||
|
size.height = YGUndefined;
|
||||||
|
}
|
||||||
|
[self calculateLayoutWithSize:size];
|
||||||
|
YGApplyLayoutToViewHierarchy(self.view, preserveOrigin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (CGSize)intrinsicSize
|
- (CGSize)intrinsicSize
|
||||||
{
|
{
|
||||||
const CGSize constrainedSize = {
|
const CGSize constrainedSize = {
|
||||||
@@ -244,8 +301,6 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
return [self calculateLayoutWithSize:constrainedSize];
|
return [self calculateLayoutWithSize:constrainedSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private
|
|
||||||
|
|
||||||
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
- (CGSize)calculateLayoutWithSize:(CGSize)size
|
||||||
{
|
{
|
||||||
NSAssert([NSThread isMainThread], @"Yoga calculation must be done on main.");
|
NSAssert([NSThread isMainThread], @"Yoga calculation must be done on main.");
|
||||||
@@ -266,6 +321,8 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - Private
|
||||||
|
|
||||||
static YGSize YGMeasureView(
|
static YGSize YGMeasureView(
|
||||||
YGNodeRef node,
|
YGNodeRef node,
|
||||||
float width,
|
float width,
|
||||||
@@ -277,10 +334,20 @@ static YGSize YGMeasureView(
|
|||||||
const CGFloat constrainedHeight = (heightMode == YGMeasureModeUndefined) ? CGFLOAT_MAX: height;
|
const CGFloat constrainedHeight = (heightMode == YGMeasureModeUndefined) ? CGFLOAT_MAX: height;
|
||||||
|
|
||||||
UIView *view = (__bridge UIView*) YGNodeGetContext(node);
|
UIView *view = (__bridge UIView*) YGNodeGetContext(node);
|
||||||
const CGSize sizeThatFits = [view sizeThatFits:(CGSize) {
|
CGSize sizeThatFits = CGSizeZero;
|
||||||
.width = constrainedWidth,
|
|
||||||
.height = constrainedHeight,
|
// The default implementation of sizeThatFits: returns the existing size of
|
||||||
}];
|
// the view. That means that if we want to layout an empty UIView, which
|
||||||
|
// already has got a frame set, its measured size should be CGSizeZero, but
|
||||||
|
// UIKit returns the existing size.
|
||||||
|
//
|
||||||
|
// See https://github.com/facebook/yoga/issues/606 for more information.
|
||||||
|
if (!view.yoga.isUIView || [view.subviews count] > 0) {
|
||||||
|
sizeThatFits = [view sizeThatFits:(CGSize){
|
||||||
|
.width = constrainedWidth,
|
||||||
|
.height = constrainedHeight,
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
return (YGSize) {
|
return (YGSize) {
|
||||||
.width = YGSanitizeMeasurement(constrainedWidth, sizeThatFits.width, widthMode),
|
.width = YGSanitizeMeasurement(constrainedWidth, sizeThatFits.width, widthMode),
|
||||||
@@ -334,7 +401,7 @@ static void YGAttachNodesFromViewHierachy(UIView *const view)
|
|||||||
|
|
||||||
NSMutableArray<UIView *> *subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
NSMutableArray<UIView *> *subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
||||||
for (UIView *subview in view.subviews) {
|
for (UIView *subview in view.subviews) {
|
||||||
if (subview.yoga.isIncludedInLayout) {
|
if (subview.yoga.isEnabled && subview.yoga.isIncludedInLayout) {
|
||||||
[subviewsToInclude addObject:subview];
|
[subviewsToInclude addObject:subview];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,9 +425,7 @@ static void YGRemoveAllChildren(const YGNodeRef node)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (YGNodeGetChildCount(node) > 0) {
|
YGNodeRemoveAllChildren(node);
|
||||||
YGNodeRemoveChild(node, YGNodeGetChild(node, YGNodeGetChildCount(node) - 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGFloat YGRoundPixelValue(CGFloat value)
|
static CGFloat YGRoundPixelValue(CGFloat value)
|
||||||
|
44
YogaKit/Source/YGLayoutExtensions.swift
Normal file
44
YogaKit/Source/YGLayoutExtensions.swift
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
postfix operator %
|
||||||
|
|
||||||
|
extension Int {
|
||||||
|
public static postfix func %(value: Int) -> YGValue {
|
||||||
|
return YGValue(value: Float(value), unit: .percent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Float {
|
||||||
|
public static postfix func %(value: Float) -> YGValue {
|
||||||
|
return YGValue(value: value, unit: .percent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension CGFloat {
|
||||||
|
public static postfix func %(value: CGFloat) -> YGValue {
|
||||||
|
return YGValue(value: Float(value), unit: .percent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension YGValue : ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral {
|
||||||
|
public init(integerLiteral value: Int) {
|
||||||
|
self = YGValue(value: Float(value), unit: .point)
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(floatLiteral value: Float) {
|
||||||
|
self = YGValue(value: value, unit: .point)
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(_ value: Float) {
|
||||||
|
self = YGValue(value: value, unit: .point)
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(_ value: CGFloat) {
|
||||||
|
self = YGValue(value: Float(value), unit: .point)
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
@@ -21,7 +19,8 @@
|
|||||||
- (void)testConfigureLayoutIsNoOpWithNilBlock
|
- (void)testConfigureLayoutIsNoOpWithNilBlock
|
||||||
{
|
{
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
XCTAssertNoThrow([view configureLayoutWithBlock:nil]);
|
id block = nil;
|
||||||
|
XCTAssertNoThrow([view configureLayoutWithBlock:block]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testConfigureLayoutBlockWorksWithValidBlock
|
- (void)testConfigureLayoutBlockWorksWithValidBlock
|
||||||
@@ -30,11 +29,11 @@
|
|||||||
[view configureLayoutWithBlock:^(YGLayout *layout){
|
[view configureLayoutWithBlock:^(YGLayout *layout){
|
||||||
XCTAssertNotNil(layout);
|
XCTAssertNotNil(layout);
|
||||||
layout.isEnabled = YES;
|
layout.isEnabled = YES;
|
||||||
layout.width = 25;
|
layout.width = YGPointValue(25);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
XCTAssertTrue(view.yoga.isEnabled);
|
XCTAssertTrue(view.yoga.isEnabled);
|
||||||
XCTAssertEqual(view.yoga.width, 25);
|
XCTAssertEqual(view.yoga.width.value, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testNodesAreDeallocedWithSingleView
|
- (void)testNodesAreDeallocedWithSingleView
|
||||||
@@ -43,7 +42,7 @@
|
|||||||
|
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view.yoga.flexBasis = 1;
|
view.yoga.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
layoutRef = view.yoga;
|
layoutRef = view.yoga;
|
||||||
XCTAssertNotNil(layoutRef);
|
XCTAssertNotNil(layoutRef);
|
||||||
@@ -62,11 +61,11 @@
|
|||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
topLayout = view.yoga;
|
topLayout = view.yoga;
|
||||||
topLayout.flexBasis = 1;
|
topLayout.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subviewLayout = subview.yoga;
|
subviewLayout = subview.yoga;
|
||||||
subviewLayout.flexBasis = 1;
|
subviewLayout.flexBasis = YGPointValue(1);
|
||||||
|
|
||||||
view = nil;
|
view = nil;
|
||||||
}
|
}
|
||||||
@@ -112,9 +111,9 @@
|
|||||||
|
|
||||||
UIView *textBadgeView = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *textBadgeView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
textBadgeView.yoga.isEnabled = YES;
|
textBadgeView.yoga.isEnabled = YES;
|
||||||
textBadgeView.yoga.margin = 0;
|
textBadgeView.yoga.margin = YGPointValue(0);
|
||||||
textBadgeView.yoga.width = 10;
|
textBadgeView.yoga.width = YGPointValue(10);
|
||||||
textBadgeView.yoga.height = 10;
|
textBadgeView.yoga.height = YGPointValue(10);
|
||||||
[container addSubview:textBadgeView];
|
[container addSubview:textBadgeView];
|
||||||
|
|
||||||
const CGSize textBadgeViewSize = textBadgeView.yoga.intrinsicSize;
|
const CGSize textBadgeViewSize = textBadgeView.yoga.intrinsicSize;
|
||||||
@@ -128,6 +127,15 @@
|
|||||||
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
|
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testSizeThatFitsEmptyView {
|
||||||
|
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 200, 200)];
|
||||||
|
view.yoga.isEnabled = YES;
|
||||||
|
|
||||||
|
const CGSize viewSize = view.yoga.intrinsicSize;
|
||||||
|
XCTAssertEqual(viewSize.height, 0);
|
||||||
|
XCTAssertEqual(viewSize.width, 0);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testPreservingOrigin
|
- (void)testPreservingOrigin
|
||||||
{
|
{
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,75)];
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,75)];
|
||||||
@@ -135,14 +143,14 @@
|
|||||||
|
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.flexBasis = 0;
|
view.yoga.flexBasis = YGPointValue(0);
|
||||||
view.yoga.flexGrow = 1;
|
view.yoga.flexGrow = 1;
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
UIView *view2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
view2.yoga.isEnabled = YES;
|
view2.yoga.isEnabled = YES;
|
||||||
view2.yoga.marginTop = 25;
|
view2.yoga.marginTop = YGPointValue(25);
|
||||||
view2.yoga.flexBasis = 0;
|
view2.yoga.flexBasis = YGPointValue(0);
|
||||||
view2.yoga.flexGrow = 1;
|
view2.yoga.flexGrow = 1;
|
||||||
[container addSubview:view2];
|
[container addSubview:view2];
|
||||||
|
|
||||||
@@ -153,6 +161,59 @@
|
|||||||
XCTAssertEqual(25, view2.frame.origin.y);
|
XCTAssertEqual(25, view2.frame.origin.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testContainerWithFlexibleWidthGetsCorrectlySized
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
||||||
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
|
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
|
view.yoga.isEnabled = YES;
|
||||||
|
view.yoga.width = YGPointValue(100);
|
||||||
|
view.yoga.height = YGPointValue(100);
|
||||||
|
[container addSubview:view];
|
||||||
|
|
||||||
|
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth];
|
||||||
|
XCTAssertEqual(100, container.frame.size.width);
|
||||||
|
XCTAssertEqual(200, container.frame.size.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testContainerWithFlexibleHeightGetsCorrectlySized
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
||||||
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
|
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
|
view.yoga.isEnabled = YES;
|
||||||
|
view.yoga.width = YGPointValue(100);
|
||||||
|
view.yoga.height = YGPointValue(100);
|
||||||
|
[container addSubview:view];
|
||||||
|
|
||||||
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleHeight];
|
||||||
|
XCTAssertEqual(200, container.frame.size.width);
|
||||||
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testContainerWithFlexibleWidthAndHeightGetsCorrectlySized
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
|
||||||
|
container.yoga.isEnabled = YES;
|
||||||
|
|
||||||
|
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||||
|
view.yoga.isEnabled = YES;
|
||||||
|
view.yoga.width = YGPointValue(100);
|
||||||
|
view.yoga.height = YGPointValue(100);
|
||||||
|
[container addSubview:view];
|
||||||
|
|
||||||
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth |
|
||||||
|
YGDimensionFlexibilityFlexibleHeight];
|
||||||
|
XCTAssertEqual(100, container.frame.size.width);
|
||||||
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testMarkingDirtyOnlyWorksOnLeafNodes
|
- (void)testMarkingDirtyOnlyWorksOnLeafNodes
|
||||||
{
|
{
|
||||||
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
@@ -388,12 +449,12 @@
|
|||||||
XCTAssertTrue(view.yoga.isLeaf);
|
XCTAssertTrue(view.yoga.isLeaf);
|
||||||
|
|
||||||
view.yoga.isEnabled = YES;
|
view.yoga.isEnabled = YES;
|
||||||
view.yoga.width = 50.0;
|
view.yoga.width = YGPointValue(50);
|
||||||
XCTAssertTrue(view.yoga.isLeaf);
|
XCTAssertTrue(view.yoga.isLeaf);
|
||||||
|
|
||||||
UIView *const subview = view.subviews[0];
|
UIView *const subview = view.subviews[0];
|
||||||
subview.yoga.isEnabled = YES;
|
subview.yoga.isEnabled = YES;
|
||||||
subview.yoga.width = 50.0;
|
subview.yoga.width = YGPointValue(50);
|
||||||
XCTAssertFalse(view.yoga.isLeaf);
|
XCTAssertFalse(view.yoga.isLeaf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,14 +466,14 @@
|
|||||||
|
|
||||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview1.yoga.isEnabled = YES;
|
subview1.yoga.isEnabled = YES;
|
||||||
subview1.yoga.width = 100;
|
subview1.yoga.width = YGPointValue(100);
|
||||||
subview1.yoga.flexGrow = 1;
|
subview1.yoga.flexGrow = 1;
|
||||||
subview1.yoga.flexDirection = YGFlexDirectionColumn;
|
subview1.yoga.flexDirection = YGFlexDirectionColumn;
|
||||||
[container addSubview:subview1];
|
[container addSubview:subview1];
|
||||||
|
|
||||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
subview2.yoga.isEnabled = YES;
|
subview2.yoga.isEnabled = YES;
|
||||||
subview2.yoga.width = 150;
|
subview2.yoga.width = YGPointValue(150);
|
||||||
subview2.yoga.flexGrow = 1;
|
subview2.yoga.flexGrow = 1;
|
||||||
subview2.yoga.flexDirection = YGFlexDirectionColumn;
|
subview2.yoga.flexDirection = YGFlexDirectionColumn;
|
||||||
[container addSubview:subview2];
|
[container addSubview:subview2];
|
||||||
@@ -473,155 +534,195 @@
|
|||||||
[container.yoga applyLayoutPreservingOrigin:YES];
|
[container.yoga applyLayoutPreservingOrigin:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testPointPercent
|
||||||
|
{
|
||||||
|
XCTAssertEqual(YGPointValue(1).value, 1);
|
||||||
|
XCTAssertEqual(YGPointValue(1).unit, YGUnitPoint);
|
||||||
|
XCTAssertEqual(YGPercentValue(2).value, 2);
|
||||||
|
XCTAssertEqual(YGPercentValue(2).unit, YGUnitPercent);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testPositionalPropertiesWork
|
- (void)testPositionalPropertiesWork
|
||||||
{
|
{
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
|
||||||
view.yoga.left = 1;
|
view.yoga.left = YGPointValue(1);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeLeft).value, 1);
|
XCTAssertEqual(view.yoga.left.value, 1);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeLeft).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.left.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.left, 1);
|
view.yoga.left = YGPercentValue(2);
|
||||||
|
XCTAssertEqual(view.yoga.left.value, 2);
|
||||||
|
XCTAssertEqual(view.yoga.left.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.right = 2;
|
view.yoga.right = YGPointValue(3);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeRight).value, 2);
|
XCTAssertEqual(view.yoga.right.value, 3);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeRight).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.right.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.right, 2);
|
view.yoga.right = YGPercentValue(4);
|
||||||
|
XCTAssertEqual(view.yoga.right.value, 4);
|
||||||
|
XCTAssertEqual(view.yoga.right.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.top = 3;
|
view.yoga.top = YGPointValue(5);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeTop).value, 3);
|
XCTAssertEqual(view.yoga.top.value, 5);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeTop).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.top.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.top, 3);
|
view.yoga.top = YGPercentValue(6);
|
||||||
|
XCTAssertEqual(view.yoga.top.value, 6);
|
||||||
|
XCTAssertEqual(view.yoga.top.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.bottom = 4;
|
view.yoga.bottom = YGPointValue(7);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeBottom).value, 4);
|
XCTAssertEqual(view.yoga.bottom.value, 7);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeBottom).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.bottom.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.bottom, 4);
|
view.yoga.bottom = YGPercentValue(8);
|
||||||
|
XCTAssertEqual(view.yoga.bottom.value, 8);
|
||||||
|
XCTAssertEqual(view.yoga.bottom.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.start = 5;
|
view.yoga.start = YGPointValue(9);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeStart).value, 5);
|
XCTAssertEqual(view.yoga.start.value, 9);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeStart).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.start.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.start, 5);
|
view.yoga.start = YGPercentValue(10);
|
||||||
|
XCTAssertEqual(view.yoga.start.value, 10);
|
||||||
|
XCTAssertEqual(view.yoga.start.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.end = 6;
|
view.yoga.end = YGPointValue(11);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeEnd).value, 6);
|
XCTAssertEqual(view.yoga.end.value, 11);
|
||||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeEnd).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.end.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.end, 6);
|
view.yoga.end = YGPercentValue(12);
|
||||||
|
XCTAssertEqual(view.yoga.end.value, 12);
|
||||||
|
XCTAssertEqual(view.yoga.end.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testMarginPropertiesWork
|
- (void)testMarginPropertiesWork
|
||||||
{
|
{
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
|
||||||
view.yoga.margin = 1;
|
view.yoga.margin = YGPointValue(1);
|
||||||
XCTAssertEqual(view.yoga.margin, 1);
|
XCTAssertEqual(view.yoga.margin.value, 1);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginLeft));
|
XCTAssertEqual(view.yoga.margin.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginRight));
|
view.yoga.margin = YGPercentValue(2);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginStart));
|
XCTAssertEqual(view.yoga.margin.value, 2);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginEnd));
|
XCTAssertEqual(view.yoga.margin.unit, YGUnitPercent);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginTop));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.marginBottom));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.marginHorizontal));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.marginVertical));
|
|
||||||
|
|
||||||
view.yoga.marginHorizontal = 2;
|
view.yoga.marginHorizontal = YGPointValue(3);
|
||||||
XCTAssertEqual(view.yoga.marginHorizontal, 2);
|
XCTAssertEqual(view.yoga.marginHorizontal.value, 3);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginLeft));
|
XCTAssertEqual(view.yoga.marginHorizontal.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginRight));
|
view.yoga.marginHorizontal = YGPercentValue(4);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginStart));
|
XCTAssertEqual(view.yoga.marginHorizontal.value, 4);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginEnd));
|
XCTAssertEqual(view.yoga.marginHorizontal.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginVertical = 3;
|
view.yoga.marginVertical = YGPointValue(5);
|
||||||
XCTAssertEqual(view.yoga.marginVertical, 3);
|
XCTAssertEqual(view.yoga.marginVertical.value, 5);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginTop));
|
XCTAssertEqual(view.yoga.marginVertical.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.marginBottom));
|
view.yoga.marginVertical = YGPercentValue(6);
|
||||||
|
XCTAssertEqual(view.yoga.marginVertical.value, 6);
|
||||||
|
XCTAssertEqual(view.yoga.marginVertical.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginLeft = 4;
|
view.yoga.marginLeft = YGPointValue(7);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).value, 4);
|
XCTAssertEqual(view.yoga.marginLeft.value, 7);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginLeft.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginLeft, 4);
|
view.yoga.marginLeft = YGPercentValue(8);
|
||||||
|
XCTAssertEqual(view.yoga.marginLeft.value, 8);
|
||||||
|
XCTAssertEqual(view.yoga.marginLeft.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginRight = 5;
|
view.yoga.marginRight = YGPointValue(9);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).value, 5);
|
XCTAssertEqual(view.yoga.marginRight.value, 9);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginRight.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginRight, 5);
|
view.yoga.marginRight = YGPercentValue(10);
|
||||||
|
XCTAssertEqual(view.yoga.marginRight.value, 10);
|
||||||
|
XCTAssertEqual(view.yoga.marginRight.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginTop = 6;
|
view.yoga.marginTop = YGPointValue(11);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).value, 6);
|
XCTAssertEqual(view.yoga.marginTop.value, 11);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginTop.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginTop, 6);
|
view.yoga.marginTop = YGPercentValue(12);
|
||||||
|
XCTAssertEqual(view.yoga.marginTop.value, 12);
|
||||||
|
XCTAssertEqual(view.yoga.marginTop.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginBottom = 7;
|
view.yoga.marginBottom = YGPointValue(13);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).value, 7);
|
XCTAssertEqual(view.yoga.marginBottom.value, 13);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginBottom.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginBottom, 7);
|
view.yoga.marginBottom = YGPercentValue(14);
|
||||||
|
XCTAssertEqual(view.yoga.marginBottom.value, 14);
|
||||||
|
XCTAssertEqual(view.yoga.marginBottom.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginStart = 8;
|
view.yoga.marginStart = YGPointValue(15);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).value, 8);
|
XCTAssertEqual(view.yoga.marginStart.value, 15);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginStart.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginStart, 8);
|
view.yoga.marginStart = YGPercentValue(16);
|
||||||
|
XCTAssertEqual(view.yoga.marginStart.value, 16);
|
||||||
|
XCTAssertEqual(view.yoga.marginStart.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.marginEnd = 9;
|
view.yoga.marginEnd = YGPointValue(17);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).value, 9);
|
XCTAssertEqual(view.yoga.marginEnd.value, 17);
|
||||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.marginEnd.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.marginEnd, 9);
|
view.yoga.marginEnd = YGPercentValue(18);
|
||||||
|
XCTAssertEqual(view.yoga.marginEnd.value, 18);
|
||||||
|
XCTAssertEqual(view.yoga.marginEnd.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPaddingPropertiesWork
|
- (void)testPaddingPropertiesWork
|
||||||
{
|
{
|
||||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
|
||||||
view.yoga.padding = 1;
|
view.yoga.padding = YGPointValue(1);
|
||||||
XCTAssertEqual(view.yoga.padding, 1);
|
XCTAssertEqual(view.yoga.padding.value, 1);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingLeft));
|
XCTAssertEqual(view.yoga.padding.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingRight));
|
view.yoga.padding = YGPercentValue(2);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingStart));
|
XCTAssertEqual(view.yoga.padding.value, 2);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingEnd));
|
XCTAssertEqual(view.yoga.padding.unit, YGUnitPercent);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingTop));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingBottom));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingHorizontal));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingVertical));
|
|
||||||
|
|
||||||
view.yoga.paddingHorizontal = 2;
|
view.yoga.paddingHorizontal = YGPointValue(3);
|
||||||
XCTAssertEqual(view.yoga.paddingHorizontal, 2);
|
XCTAssertEqual(view.yoga.paddingHorizontal.value, 3);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingLeft));
|
XCTAssertEqual(view.yoga.paddingHorizontal.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingRight));
|
view.yoga.paddingHorizontal = YGPercentValue(4);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingStart));
|
XCTAssertEqual(view.yoga.paddingHorizontal.value, 4);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingEnd));
|
XCTAssertEqual(view.yoga.paddingHorizontal.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingVertical = 3;
|
view.yoga.paddingVertical = YGPointValue(5);
|
||||||
XCTAssertEqual(view.yoga.paddingVertical, 3);
|
XCTAssertEqual(view.yoga.paddingVertical.value, 5);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingTop));
|
XCTAssertEqual(view.yoga.paddingVertical.unit, YGUnitPoint);
|
||||||
XCTAssertTrue(isnan(view.yoga.paddingBottom));
|
view.yoga.paddingVertical = YGPercentValue(6);
|
||||||
|
XCTAssertEqual(view.yoga.paddingVertical.value, 6);
|
||||||
|
XCTAssertEqual(view.yoga.paddingVertical.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingLeft = 4;
|
view.yoga.paddingLeft = YGPointValue(7);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).value, 4);
|
XCTAssertEqual(view.yoga.paddingLeft.value, 7);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingLeft.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingLeft, 4);
|
view.yoga.paddingLeft = YGPercentValue(8);
|
||||||
|
XCTAssertEqual(view.yoga.paddingLeft.value, 8);
|
||||||
|
XCTAssertEqual(view.yoga.paddingLeft.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingRight = 5;
|
view.yoga.paddingRight = YGPointValue(9);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).value, 5);
|
XCTAssertEqual(view.yoga.paddingRight.value, 9);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingRight.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingRight, 5);
|
view.yoga.paddingRight = YGPercentValue(10);
|
||||||
|
XCTAssertEqual(view.yoga.paddingRight.value, 10);
|
||||||
|
XCTAssertEqual(view.yoga.paddingRight.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingTop = 6;
|
view.yoga.paddingTop = YGPointValue(11);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).value, 6);
|
XCTAssertEqual(view.yoga.paddingTop.value, 11);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingTop.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingTop, 6);
|
view.yoga.paddingTop = YGPercentValue(12);
|
||||||
|
XCTAssertEqual(view.yoga.paddingTop.value, 12);
|
||||||
|
XCTAssertEqual(view.yoga.paddingTop.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingBottom = 7;
|
view.yoga.paddingBottom = YGPointValue(13);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).value, 7);
|
XCTAssertEqual(view.yoga.paddingBottom.value, 13);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingBottom.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingBottom, 7);
|
view.yoga.paddingBottom = YGPercentValue(14);
|
||||||
|
XCTAssertEqual(view.yoga.paddingBottom.value, 14);
|
||||||
|
XCTAssertEqual(view.yoga.paddingBottom.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingStart = 8;
|
view.yoga.paddingStart = YGPointValue(15);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).value, 8);
|
XCTAssertEqual(view.yoga.paddingStart.value, 15);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingStart.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingStart, 8);
|
view.yoga.paddingStart = YGPercentValue(16);
|
||||||
|
XCTAssertEqual(view.yoga.paddingStart.value, 16);
|
||||||
|
XCTAssertEqual(view.yoga.paddingStart.unit, YGUnitPercent);
|
||||||
|
|
||||||
view.yoga.paddingEnd = 9;
|
view.yoga.paddingEnd = YGPointValue(17);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).value, 9);
|
XCTAssertEqual(view.yoga.paddingEnd.value, 17);
|
||||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).unit, YGUnitPoint);
|
XCTAssertEqual(view.yoga.paddingEnd.unit, YGUnitPoint);
|
||||||
XCTAssertEqual(view.yoga.paddingEnd, 9);
|
view.yoga.paddingEnd = YGPercentValue(18);
|
||||||
|
XCTAssertEqual(view.yoga.paddingEnd.value, 18);
|
||||||
|
XCTAssertEqual(view.yoga.paddingEnd.unit, YGUnitPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testBorderWidthPropertiesWork
|
- (void)testBorderWidthPropertiesWork
|
||||||
@@ -630,12 +731,6 @@
|
|||||||
|
|
||||||
view.yoga.borderWidth = 1;
|
view.yoga.borderWidth = 1;
|
||||||
XCTAssertEqual(view.yoga.borderWidth, 1);
|
XCTAssertEqual(view.yoga.borderWidth, 1);
|
||||||
XCTAssertTrue(isnan(view.yoga.borderLeftWidth));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.borderRightWidth));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.borderStartWidth));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.borderEndWidth));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.borderTopWidth));
|
|
||||||
XCTAssertTrue(isnan(view.yoga.borderBottomWidth));
|
|
||||||
|
|
||||||
view.yoga.borderLeftWidth = 2;
|
view.yoga.borderLeftWidth = 2;
|
||||||
XCTAssertEqual(view.yoga.borderLeftWidth, 2);
|
XCTAssertEqual(view.yoga.borderLeftWidth, 2);
|
||||||
|
@@ -4,9 +4,9 @@ PODS:
|
|||||||
- IGListKit/Default (2.1.0):
|
- IGListKit/Default (2.1.0):
|
||||||
- IGListKit/Diffing
|
- IGListKit/Diffing
|
||||||
- IGListKit/Diffing (2.1.0)
|
- IGListKit/Diffing (2.1.0)
|
||||||
- Yoga (1.2.0)
|
- Yoga (1.7.0)
|
||||||
- YogaKit (1.2.0):
|
- YogaKit (1.7.0):
|
||||||
- Yoga (~> 1.2)
|
- Yoga (~> 1.7)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- IGListKit (~> 2.1.0)
|
- IGListKit (~> 2.1.0)
|
||||||
@@ -14,13 +14,13 @@ DEPENDENCIES:
|
|||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
YogaKit:
|
YogaKit:
|
||||||
:path: "../../YogaKit.podspec"
|
:path: ../../YogaKit.podspec
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
IGListKit: b826c68ef7a4ae1626c09d4d3e1ea7a169e6c36e
|
IGListKit: b826c68ef7a4ae1626c09d4d3e1ea7a169e6c36e
|
||||||
Yoga: 20fc010c282cc5f3c27ce512de1329cd1e72b077
|
Yoga: 2ed1d7accfef3610a67f58c0cf101a0662137f2c
|
||||||
YogaKit: 72d5c8a806dc5cf2aa50c93a6dd88913cdbec6fe
|
YogaKit: 31576530e8fcae3175469719ec3212397403330b
|
||||||
|
|
||||||
PODFILE CHECKSUM: 216f8e7127767709e0e43f3711208d238fa5c404
|
PODFILE CHECKSUM: 216f8e7127767709e0e43f3711208d238fa5c404
|
||||||
|
|
||||||
COCOAPODS: 1.2.0
|
COCOAPODS: 1.1.1
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
// !$*UTF8*$!
|
// !$*UTF8*$!
|
||||||
{
|
{
|
||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
|
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0820"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
||||||
|
BuildableName = "YogaKitSample.app"
|
||||||
|
BlueprintName = "YogaKitSample"
|
||||||
|
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "638A944E1E215CC800A726AD"
|
||||||
|
BuildableName = "YogaKitSampleTests.xctest"
|
||||||
|
BlueprintName = "YogaKitSampleTests"
|
||||||
|
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
||||||
|
BuildableName = "YogaKitSample.app"
|
||||||
|
BlueprintName = "YogaKitSample"
|
||||||
|
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
||||||
|
BuildableName = "YogaKitSample.app"
|
||||||
|
BlueprintName = "YogaKitSample"
|
||||||
|
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
||||||
|
BuildableName = "YogaKitSample.app"
|
||||||
|
BlueprintName = "YogaKitSample"
|
||||||
|
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -12,6 +11,11 @@ import YogaKit
|
|||||||
|
|
||||||
struct DemoItem {
|
struct DemoItem {
|
||||||
let name: String
|
let name: String
|
||||||
|
root.backgroundColor = .red
|
||||||
|
root.yoga.isEnabled = true
|
||||||
|
root.yoga.width = YGValue(self.view.bounds.size.width)
|
||||||
|
root.yoga.height = YGValue(self.view.bounds.size.height)
|
||||||
|
root.yoga.alignItems = .center
|
||||||
}
|
}
|
||||||
|
|
||||||
final class SwiftViewController: UIViewController, IGListAdapterDataSource {
|
final class SwiftViewController: UIViewController, IGListAdapterDataSource {
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ViewController.h"
|
#import "ViewController.h"
|
||||||
@@ -17,16 +16,16 @@
|
|||||||
UIView *root = self.view;
|
UIView *root = self.view;
|
||||||
root.backgroundColor = [UIColor redColor];
|
root.backgroundColor = [UIColor redColor];
|
||||||
root.yoga.isEnabled = YES;
|
root.yoga.isEnabled = YES;
|
||||||
root.yoga.width = self.view.bounds.size.width;
|
root.yoga.width = YGPointValue(self.view.bounds.size.width);
|
||||||
root.yoga.height = self.view.bounds.size.height;
|
root.yoga.height = YGPointValue(self.view.bounds.size.height);
|
||||||
root.yoga.alignItems = YGAlignCenter;
|
root.yoga.alignItems = YGAlignCenter;
|
||||||
root.yoga.justifyContent = YGJustifyCenter;
|
root.yoga.justifyContent = YGJustifyCenter;
|
||||||
|
|
||||||
UIView *child1 = [UIView new];
|
UIView *child1 = [UIView new];
|
||||||
child1.backgroundColor = [UIColor blueColor];
|
child1.backgroundColor = [UIColor blueColor];
|
||||||
child1.yoga.isEnabled = YES;
|
child1.yoga.isEnabled = YES;
|
||||||
child1.yoga.width = 100;
|
child1.yoga.width = YGPointValue(100);
|
||||||
child1.yoga.height = 100;
|
child1.yoga.height = YGPointValue(100);
|
||||||
|
|
||||||
UIView *child2 = [UIView new];
|
UIView *child2 = [UIView new];
|
||||||
child2.backgroundColor = [UIColor greenColor];
|
child2.backgroundColor = [UIColor greenColor];
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -15,32 +14,38 @@ final class BasicViewController: UIViewController {
|
|||||||
|
|
||||||
let root = self.view!
|
let root = self.view!
|
||||||
root.backgroundColor = .white
|
root.backgroundColor = .white
|
||||||
root.yoga.isEnabled = true
|
root.configureLayout { (layout) in
|
||||||
root.yoga.width = containerSize.width
|
layout.isEnabled = true
|
||||||
root.yoga.height = containerSize.height
|
layout.width = YGValue(containerSize.width)
|
||||||
root.yoga.alignItems = .center
|
layout.height = YGValue(containerSize.height)
|
||||||
root.yoga.justifyContent = .center
|
layout.alignItems = .center
|
||||||
|
layout.justifyContent = .center
|
||||||
|
}
|
||||||
|
|
||||||
let child1 = UIView()
|
let child1 = UIView()
|
||||||
child1.backgroundColor = .blue
|
child1.backgroundColor = .blue
|
||||||
child1.yoga.isEnabled = true
|
child1.configureLayout { (layout) in
|
||||||
child1.yoga.width = 100
|
layout.isEnabled = true
|
||||||
child1.yoga.height = 10
|
layout.width = 100
|
||||||
child1.yoga.marginBottom = 25
|
layout.height = 10
|
||||||
|
layout.marginBottom = 25
|
||||||
|
}
|
||||||
root.addSubview(child1)
|
root.addSubview(child1)
|
||||||
|
|
||||||
let child2 = UIView()
|
let child2 = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
|
||||||
child2.yoga.isEnabled = true
|
|
||||||
child2.yoga.alignSelf = .flexEnd
|
|
||||||
child2.backgroundColor = .green
|
child2.backgroundColor = .green
|
||||||
child2.frame = CGRect(x: 0, y: 0, width: 200, height: 100)
|
child2.configureLayout { (layout) in
|
||||||
|
layout.isEnabled = true
|
||||||
|
layout.alignSelf = .flexEnd
|
||||||
|
}
|
||||||
root.addSubview(child2)
|
root.addSubview(child2)
|
||||||
|
|
||||||
let child3 = UIView()
|
let child3 = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
|
||||||
child3.yoga.isEnabled = true
|
|
||||||
child3.yoga.alignSelf = .flexStart
|
|
||||||
child3.backgroundColor = .yellow
|
child3.backgroundColor = .yellow
|
||||||
child3.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
|
child3.configureLayout { (layout) in
|
||||||
|
layout.isEnabled = true
|
||||||
|
layout.alignSelf = .flexStart
|
||||||
|
}
|
||||||
root.addSubview(child3)
|
root.addSubview(child3)
|
||||||
|
|
||||||
root.yoga.applyLayout(preservingOrigin: true)
|
root.yoga.applyLayout(preservingOrigin: true)
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -17,40 +16,50 @@ final class LayoutInclusionViewController: UIViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
let root = self.view!
|
let root = self.view!
|
||||||
root.backgroundColor = .white
|
root.backgroundColor = .white
|
||||||
root.yoga.isEnabled = true
|
root.configureLayout { (layout) in
|
||||||
root.yoga.flexDirection = .column
|
layout.isEnabled = true
|
||||||
root.yoga.justifyContent = .spaceAround
|
layout.flexDirection = .column
|
||||||
|
layout.justifyContent = .spaceAround
|
||||||
|
}
|
||||||
|
|
||||||
contentView.backgroundColor = .clear
|
contentView.backgroundColor = .clear
|
||||||
contentView.layer.borderColor = UIColor.lightGray.cgColor
|
contentView.layer.borderColor = UIColor.lightGray.cgColor
|
||||||
contentView.layer.borderWidth = 1.0
|
contentView.layer.borderWidth = 1.0
|
||||||
contentView.yoga.isEnabled = true
|
contentView.configureLayout { (layout) in
|
||||||
contentView.yoga.height = 300
|
layout.isEnabled = true
|
||||||
contentView.yoga.width = self.view.bounds.size.width
|
layout.height = 300
|
||||||
contentView.yoga.flexDirection = .row
|
layout.width = YGValue(self.view.bounds.size.width)
|
||||||
contentView.yoga.justifyContent = .center
|
layout.flexDirection = .row
|
||||||
contentView.yoga.paddingHorizontal = 25
|
layout.justifyContent = .center
|
||||||
|
layout.paddingHorizontal = 25
|
||||||
|
}
|
||||||
self.view.addSubview(contentView)
|
self.view.addSubview(contentView)
|
||||||
|
|
||||||
let redView = UIView(frame: .zero)
|
let redView = UIView(frame: .zero)
|
||||||
redView.backgroundColor = .red
|
redView.backgroundColor = .red
|
||||||
redView.yoga.isEnabled = true
|
redView.configureLayout { (layout) in
|
||||||
redView.yoga.flexGrow = 1
|
layout.isEnabled = true
|
||||||
redView.yoga.flexShrink = 1
|
layout.flexGrow = 1
|
||||||
|
layout.flexShrink = 1
|
||||||
|
}
|
||||||
contentView.addSubview(redView)
|
contentView.addSubview(redView)
|
||||||
|
|
||||||
disappearingView.backgroundColor = .blue
|
disappearingView.backgroundColor = .blue
|
||||||
disappearingView.yoga.isEnabled = true
|
disappearingView.configureLayout { (layout) in
|
||||||
disappearingView.yoga.flexGrow = 1
|
layout.isEnabled = true
|
||||||
|
layout.flexGrow = 1
|
||||||
|
}
|
||||||
contentView.addSubview(disappearingView)
|
contentView.addSubview(disappearingView)
|
||||||
|
|
||||||
button.setTitle("Add Blue View", for: UIControlState.selected)
|
button.setTitle("Add Blue View", for: UIControlState.selected)
|
||||||
button.setTitle("Remove Blue View", for: UIControlState.normal)
|
button.setTitle("Remove Blue View", for: UIControlState.normal)
|
||||||
button.addTarget(self, action: #selector(buttonWasTapped), for: UIControlEvents.touchUpInside)
|
button.addTarget(self, action: #selector(buttonWasTapped), for: UIControlEvents.touchUpInside)
|
||||||
button.yoga.isEnabled = true
|
button.configureLayout { (layout) in
|
||||||
button.yoga.height = 300
|
layout.isEnabled = true
|
||||||
button.yoga.width = 300
|
layout.height = 300
|
||||||
button.yoga.alignSelf = .center
|
layout.width = 300
|
||||||
|
layout.alignSelf = .center
|
||||||
|
}
|
||||||
root.addSubview(button)
|
root.addSubview(button)
|
||||||
|
|
||||||
root.yoga.applyLayout(preservingOrigin: false)
|
root.yoga.applyLayout(preservingOrigin: false)
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
@@ -15,9 +14,11 @@ final class SingleLabelCollectionCell: UICollectionViewCell {
|
|||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
contentView.yoga.isEnabled = true
|
contentView.configureLayout { (layout) in
|
||||||
contentView.yoga.flexDirection = .column
|
layout.isEnabled = true
|
||||||
contentView.yoga.justifyContent = .flexEnd
|
layout.flexDirection = .column
|
||||||
|
layout.justifyContent = .flexEnd
|
||||||
|
}
|
||||||
|
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
label.numberOfLines = 1
|
label.numberOfLines = 1
|
||||||
@@ -26,9 +27,11 @@ final class SingleLabelCollectionCell: UICollectionViewCell {
|
|||||||
|
|
||||||
let border = UIView(frame: .zero)
|
let border = UIView(frame: .zero)
|
||||||
border.backgroundColor = .lightGray
|
border.backgroundColor = .lightGray
|
||||||
border.yoga.isEnabled = true
|
border.configureLayout { (layout) in
|
||||||
border.yoga.height = 0.5
|
layout.isEnabled = true
|
||||||
border.yoga.marginHorizontal = 25
|
layout.height = 0.5
|
||||||
|
layout.marginHorizontal = 25
|
||||||
|
}
|
||||||
contentView.addSubview(border)
|
contentView.addSubview(border)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
19
android/BUCK
19
android/BUCK
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
|
||||||
|
|
||||||
android_aar(
|
yoga_android_aar(
|
||||||
name = "android",
|
name = "android",
|
||||||
manifest_skeleton = "src/main/AndroidManifest.xml",
|
manifest_skeleton = "src/main/AndroidManifest.xml",
|
||||||
visibility = [
|
visibility = [
|
||||||
@@ -16,13 +14,12 @@ android_aar(
|
|||||||
deps = [
|
deps = [
|
||||||
ANDROID_JAVA_TARGET,
|
ANDROID_JAVA_TARGET,
|
||||||
ANDROID_RES_TARGET,
|
ANDROID_RES_TARGET,
|
||||||
INFER_ANNOTATIONS_TARGET,
|
|
||||||
JAVA_TARGET,
|
JAVA_TARGET,
|
||||||
PROGRUARD_ANNOTATIONS_TARGET,
|
PROGRUARD_ANNOTATIONS_TARGET,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
android_resource(
|
yoga_android_resource(
|
||||||
name = "res",
|
name = "res",
|
||||||
package = "com.facebook.yoga.android",
|
package = "com.facebook.yoga.android",
|
||||||
res = "src/main/res",
|
res = "src/main/res",
|
||||||
@@ -30,7 +27,3 @@ android_resource(
|
|||||||
"PUBLIC",
|
"PUBLIC",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
project_config(
|
|
||||||
src_target = ":android",
|
|
||||||
)
|
|
||||||
|
21
android/README.md
Normal file
21
android/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# YogaLayout [](https://facebook.github.io/yoga/docs/api/android/) [](https://facebook.github.io/yoga/docs/api/android/) [](https://bintray.com/facebook/maven/com.facebook.yoga.android%3Ayoga-layout/_latestVersion)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
YogaLayout is available via jcenter:
|
||||||
|
|
||||||
|
compile 'com.facebook.yoga.android:yoga-layout:1.2.0'
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Check out the docs [here](https://facebook.github.io/yoga/docs/api/android/).
|
||||||
|
|
||||||
|
We also have a sample project. To try it, clone the repo and run (with a device attached)
|
||||||
|
|
||||||
|
buck install -r android/sample
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome all pull-requests! At Facebook we sync the open source version of YogaKit daily, so we're always testing the latest changes.
|
||||||
|
|
||||||
|
See the CONTRIBUTING file for how to help out.
|
@@ -1,31 +1,35 @@
|
|||||||
apply plugin: "com.jfrog.bintray"
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
apply plugin: 'com.jfrog.bintray'
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
targetCompatibility = '1.7'
|
version = VERSION_NAME
|
||||||
sourceCompatibility = '1.7'
|
group = GROUP
|
||||||
|
|
||||||
version = '1.2.0'
|
|
||||||
group = 'com.facebook.yoga.android'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 19
|
compileSdkVersion rootProject.compileSdkVersion
|
||||||
buildToolsVersion "19.1.0"
|
buildToolsVersion rootProject.buildToolsVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 15
|
minSdkVersion rootProject.minSdkVersion
|
||||||
targetSdkVersion 19
|
targetSdkVersion rootProject.targetSdkVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
targetCompatibility rootProject.targetCompatibilityVersion
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility rootProject.sourceCompatibilityVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.facebook.yoga:yoga:1.2.0'
|
api project(':yoga')
|
||||||
}
|
}
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
@@ -45,8 +49,4 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
|
|||||||
from javadoc.destinationDir
|
from javadoc.destinationDir
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
apply from: rootProject.file('gradle/release.gradle')
|
||||||
bintrayName = "com.facebook.yoga.android:yoga-layout"
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: rootProject.file('gradle/android-jcenter-install.gradle')
|
|
||||||
|
12
android/gradle.properties
Normal file
12
android/gradle.properties
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the LICENSE
|
||||||
|
# file in the root directory of this source tree.
|
||||||
|
#
|
||||||
|
|
||||||
|
GROUP=com.facebook.yoga.android
|
||||||
|
POM_NAME=YogaLayout
|
||||||
|
POM_DESCRIPTION=YogaLayout
|
||||||
|
POM_ARTIFACT_ID=yoga-layout
|
||||||
|
POM_PACKAGING=aar
|
@@ -22,6 +22,8 @@
|
|||||||
android:targetSdkVersion="19"
|
android:targetSdkVersion="19"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
@@ -42,6 +44,11 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".BenchmarkActivity"
|
||||||
|
android:exported="false"
|
||||||
|
/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -4,9 +4,10 @@
|
|||||||
# This source code is licensed under the license found in the
|
# This source code is licensed under the license found in the
|
||||||
# LICENSE-examples file in the root directory of this source tree.
|
# LICENSE-examples file in the root directory of this source tree.
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||||
|
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
|
||||||
|
|
||||||
android_binary(
|
yoga_android_binary(
|
||||||
name = "sample",
|
name = "sample",
|
||||||
keystore = ":debug_keystore",
|
keystore = ":debug_keystore",
|
||||||
manifest = "AndroidManifest.xml",
|
manifest = "AndroidManifest.xml",
|
||||||
@@ -16,7 +17,7 @@ android_binary(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
android_resource(
|
yoga_android_resource(
|
||||||
name = "res",
|
name = "res",
|
||||||
package = "com.facebook.samples.yoga",
|
package = "com.facebook.samples.yoga",
|
||||||
res = "res",
|
res = "res",
|
||||||
@@ -28,12 +29,8 @@ android_resource(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
keystore(
|
fb_native.keystore(
|
||||||
name = "debug_keystore",
|
name = "debug_keystore",
|
||||||
properties = "debug.keystore.properties",
|
properties = "debug.keystore.properties",
|
||||||
store = "debug.keystore",
|
store = "debug.keystore",
|
||||||
)
|
)
|
||||||
|
|
||||||
project_config(
|
|
||||||
src_target = ":sample",
|
|
||||||
)
|
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE-examples file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||||
|
|
||||||
android_library(
|
yoga_android_library(
|
||||||
name = "yoga",
|
name = "yoga",
|
||||||
srcs = glob(["**/*.java"]),
|
srcs = glob(["**/*.java"]),
|
||||||
visibility = [
|
visibility = [
|
||||||
|
@@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v4.app.FragmentPagerAdapter;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
import android.support.v4.view.ViewPager;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
|
||||||
|
import com.facebook.samples.yoga.R;
|
||||||
|
import com.facebook.yoga.android.YogaViewLayoutFactory;
|
||||||
|
|
||||||
|
public class BenchmarkActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
LayoutInflater.from(this).setFactory(YogaViewLayoutFactory.getInstance());
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setContentView(R.layout.benchmark_select_layout);
|
||||||
|
|
||||||
|
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
|
||||||
|
viewPager.setAdapter(new PagerAdapter(getSupportFragmentManager()));
|
||||||
|
|
||||||
|
final ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||||
|
|
||||||
|
ActionBar.TabListener tabListener = new ActionBar.TabListener() {
|
||||||
|
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
|
||||||
|
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
|
||||||
|
viewPager.setCurrentItem(tab.getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
actionBar.addTab(
|
||||||
|
actionBar.newTab()
|
||||||
|
.setText("Inflate")
|
||||||
|
.setTabListener(tabListener));
|
||||||
|
actionBar.addTab(
|
||||||
|
actionBar.newTab()
|
||||||
|
.setText("Measure")
|
||||||
|
.setTabListener(tabListener));
|
||||||
|
actionBar.addTab(
|
||||||
|
actionBar.newTab()
|
||||||
|
.setText("Layout")
|
||||||
|
.setTabListener(tabListener));
|
||||||
|
|
||||||
|
viewPager.setOnPageChangeListener(
|
||||||
|
new ViewPager.SimpleOnPageChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
// When swiping between pages, select the
|
||||||
|
// corresponding tab.
|
||||||
|
actionBar.setSelectedNavigationItem(position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
viewPager.setOffscreenPageLimit(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
inflater.inflate(R.menu.action_bar_benchmark, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// There is only one option
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
this.finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PagerAdapter extends FragmentPagerAdapter {
|
||||||
|
public PagerAdapter(FragmentManager fm) {
|
||||||
|
super(fm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int i) {
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
return new BenchmarkInflate();
|
||||||
|
case 1:
|
||||||
|
return new BenchmarkMeasure();
|
||||||
|
default:
|
||||||
|
return new BenchmarkLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,198 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.lang.Math;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import static java.util.Collections.sort;
|
||||||
|
|
||||||
|
public class BenchmarkAggregator {
|
||||||
|
|
||||||
|
private final int GRAPH_WIDTH = 30;
|
||||||
|
private final int GRAPH_HEIGHT = 6;
|
||||||
|
|
||||||
|
private List<Long> times;
|
||||||
|
private boolean tracing;
|
||||||
|
private long lastTraceStart;
|
||||||
|
|
||||||
|
private boolean statsFresh;
|
||||||
|
private long mean;
|
||||||
|
private long variance;
|
||||||
|
private long stddev;
|
||||||
|
private long min;
|
||||||
|
private long max;
|
||||||
|
private long p10;
|
||||||
|
private long p50;
|
||||||
|
private long p90;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public BenchmarkAggregator(String name) {
|
||||||
|
times = new ArrayList<>();
|
||||||
|
tracing = false;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startTrace() {
|
||||||
|
if (tracing) {
|
||||||
|
throw new RuntimeException("Cannot start trace while running previous one");
|
||||||
|
}
|
||||||
|
tracing = true;
|
||||||
|
lastTraceStart = System.nanoTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void endTrace() {
|
||||||
|
if (!tracing) {
|
||||||
|
throw new RuntimeException("Cannot stop trace if none are running!");
|
||||||
|
}
|
||||||
|
times.add(System.nanoTime() - lastTraceStart);
|
||||||
|
tracing = false;
|
||||||
|
statsFresh = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void computeStats() {
|
||||||
|
if (statsFresh) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sort(times);
|
||||||
|
|
||||||
|
min = Long.MAX_VALUE;
|
||||||
|
max = -1;
|
||||||
|
mean = 0;
|
||||||
|
for (long f: times) {
|
||||||
|
mean += f;
|
||||||
|
if (f < min) {
|
||||||
|
min = f;
|
||||||
|
}
|
||||||
|
if (f > max) {
|
||||||
|
max = f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mean /= times.size();
|
||||||
|
|
||||||
|
variance = 0;
|
||||||
|
for (long f: times) {
|
||||||
|
variance += (f-mean)*(f-mean);
|
||||||
|
}
|
||||||
|
variance /= times.size();
|
||||||
|
stddev = (long) Math.sqrt((double) variance);
|
||||||
|
|
||||||
|
p10 = times.get(times.size()*10/100);
|
||||||
|
p50 = times.get(times.size()*50/100);
|
||||||
|
p90 = times.get(times.size()*90/100);
|
||||||
|
|
||||||
|
statsFresh = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
computeStats();
|
||||||
|
return String.format(
|
||||||
|
"%s:\n" +
|
||||||
|
"| %d samples\n" +
|
||||||
|
"| Mean %.3f\u00B1%.3fms\n" + // plusminus
|
||||||
|
"| Min %.3fms ; Max %.3fms\n" +
|
||||||
|
"| p10 %.3fms ; p50 %.3fms ; p90 %.3fms\n" +
|
||||||
|
"%s",
|
||||||
|
name,
|
||||||
|
times.size(),
|
||||||
|
mean/10e6,
|
||||||
|
stddev/10e6,
|
||||||
|
min/10e6,
|
||||||
|
max/10e6,
|
||||||
|
p10/10e6,
|
||||||
|
p50/10e6,
|
||||||
|
p90/10e6,
|
||||||
|
makeGraph());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String makeGraph() {
|
||||||
|
char canvas[][] = new char[GRAPH_HEIGHT][GRAPH_WIDTH];
|
||||||
|
for (int i = 0; i < GRAPH_HEIGHT; i++)
|
||||||
|
for (int j = 0; j < GRAPH_WIDTH; j++)
|
||||||
|
canvas[i][j] = ' ';
|
||||||
|
|
||||||
|
long bucketSize = (p90 - p10) / GRAPH_WIDTH+1;
|
||||||
|
int bucketCount[] = new int[GRAPH_WIDTH];
|
||||||
|
for (long time : times) {
|
||||||
|
if (time<p90 && time>p10) {
|
||||||
|
bucketCount[(int) ((time - p10) / bucketSize)]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int maxBucket = 0;
|
||||||
|
for (int i = 0; i < GRAPH_WIDTH; i++)
|
||||||
|
if (bucketCount[i] > maxBucket) {
|
||||||
|
maxBucket = bucketCount[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < GRAPH_HEIGHT; i++)
|
||||||
|
for (int j = 0; j < GRAPH_WIDTH; j++)
|
||||||
|
if (i < bucketCount[j] * GRAPH_HEIGHT / maxBucket) {
|
||||||
|
canvas[i][j] = 'Z';
|
||||||
|
}
|
||||||
|
|
||||||
|
String graph = new String();
|
||||||
|
for (int i = 0; i < GRAPH_HEIGHT; i++)
|
||||||
|
{
|
||||||
|
int percentage = 100 * (GRAPH_HEIGHT - i - 1) * maxBucket / (times.size() * GRAPH_HEIGHT);
|
||||||
|
graph += String.format("| %2d%% ", percentage);
|
||||||
|
for (int j = 0; j < GRAPH_WIDTH; j++)
|
||||||
|
graph += canvas[GRAPH_HEIGHT-1-i][j];
|
||||||
|
graph += '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
graph += "| p10";
|
||||||
|
for (int i = 0; i < GRAPH_WIDTH-6; i++)
|
||||||
|
graph += " ";
|
||||||
|
graph += "p90\n";
|
||||||
|
return graph;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumps the collected times to a file on the device. This allows us to grab the raw data
|
||||||
|
* and perform more in-depth analysis.
|
||||||
|
*/
|
||||||
|
public void dump(Context context) {
|
||||||
|
String state = Environment.getExternalStorageState();
|
||||||
|
if (!Environment.MEDIA_MOUNTED.equals(state)) {
|
||||||
|
Log.e("YogaLayoutBenchmark","No external file storage");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
String filename = format.format(new Date()) + "_" + name.replace(' ','_');
|
||||||
|
File file = new File(context.getExternalFilesDir(
|
||||||
|
Environment.DIRECTORY_DOCUMENTS), filename);
|
||||||
|
|
||||||
|
try {
|
||||||
|
PrintWriter printWriter = new PrintWriter(file);
|
||||||
|
for (long l : times) {
|
||||||
|
printWriter.println(l);
|
||||||
|
}
|
||||||
|
printWriter.close();
|
||||||
|
|
||||||
|
Log.i("YogaLayoutBenchmark","Benchmark data saved in "+file.getPath());
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
Log.e("YogaLayoutBenchmark", "Could not save benchmark data", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewParent;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
|
import com.facebook.samples.yoga.R;
|
||||||
|
import com.facebook.yoga.android.YogaLayout;
|
||||||
|
|
||||||
|
public class BenchmarkFragment extends Fragment implements AdapterView.OnItemSelectedListener {
|
||||||
|
private LayoutInflater mInflater;
|
||||||
|
|
||||||
|
protected com.facebook.yoga.android.YogaLayout rootLayout;
|
||||||
|
protected int yogaLayout;
|
||||||
|
protected int linearLayout;
|
||||||
|
|
||||||
|
static final Random random = new Random();
|
||||||
|
|
||||||
|
static void randomizeText(View root) {
|
||||||
|
if (root instanceof TextView) {
|
||||||
|
((TextView) root).setText("" + random.nextInt(1000));
|
||||||
|
((TextView) root).setTextSize(10 + random.nextInt(20));
|
||||||
|
ViewParent parent = root.getParent();
|
||||||
|
if (parent instanceof YogaLayout) {
|
||||||
|
((YogaLayout) parent).invalidate(root);
|
||||||
|
}
|
||||||
|
} else if (root instanceof ViewGroup) {
|
||||||
|
for (int i = 0; i < ((ViewGroup) root).getChildCount(); i++) {
|
||||||
|
randomizeText(((ViewGroup) root).getChildAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public BenchmarkFragment() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(
|
||||||
|
LayoutInflater inflater,
|
||||||
|
ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
mInflater = inflater;
|
||||||
|
|
||||||
|
rootLayout = (YogaLayout) inflater.inflate(
|
||||||
|
R.layout.benchmark_fragment,
|
||||||
|
container,
|
||||||
|
false);
|
||||||
|
|
||||||
|
Spinner benchmarkSelect = (Spinner) rootLayout.findViewById(R.id.benchmarkSelect);
|
||||||
|
String[] items = new String[]{"Basic", "Typical", "Nested"};
|
||||||
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||||
|
benchmarkSelect.setAdapter(adapter);
|
||||||
|
benchmarkSelect.setOnItemSelectedListener(this);
|
||||||
|
return rootLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
|
||||||
|
switch (pos) {
|
||||||
|
case 0:
|
||||||
|
yogaLayout = R.layout.benchmark_layout_1;
|
||||||
|
linearLayout = R.layout.benchmark_layout_1_linear;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
yogaLayout = R.layout.benchmark_layout_2;
|
||||||
|
linearLayout = R.layout.benchmark_layout_2_linear;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
default:
|
||||||
|
yogaLayout = R.layout.benchmark_layout_3;
|
||||||
|
linearLayout = R.layout.benchmark_layout_3_linear;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
updatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
yogaLayout = R.layout.benchmark_layout_1;
|
||||||
|
linearLayout = R.layout.benchmark_layout_1_linear;
|
||||||
|
updatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePreview() {
|
||||||
|
LinearLayout previewLayout = (LinearLayout) rootLayout.findViewById(R.id.preview);
|
||||||
|
View v = mInflater.inflate(yogaLayout, rootLayout, false);
|
||||||
|
v.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT));
|
||||||
|
previewLayout.removeAllViews();
|
||||||
|
previewLayout.addView(v);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.util.Log;
|
||||||
|
import com.facebook.samples.yoga.R;
|
||||||
|
|
||||||
|
public class BenchmarkInflate extends BenchmarkFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(
|
||||||
|
LayoutInflater inflater,
|
||||||
|
ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
|
Button b = (Button) rootLayout.findViewById(R.id.btn);
|
||||||
|
b.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startBenchmark();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return rootLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startBenchmark() {
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
|
TextView textView = (TextView) rootLayout.findViewById(R.id.text);
|
||||||
|
|
||||||
|
final int ITERATIONS = 500;
|
||||||
|
|
||||||
|
inflater.inflate(yogaLayout, null);
|
||||||
|
inflater.inflate(linearLayout, null);
|
||||||
|
|
||||||
|
BenchmarkAggregator yogaInflationAggregator = new BenchmarkAggregator("Yoga Inflate");
|
||||||
|
BenchmarkAggregator linearInflationAggregator = new BenchmarkAggregator("Linear Inflate");
|
||||||
|
for (int i = 0; i < ITERATIONS; i++) {
|
||||||
|
yogaInflationAggregator.startTrace();
|
||||||
|
inflater.inflate(yogaLayout, null);
|
||||||
|
yogaInflationAggregator.endTrace();
|
||||||
|
linearInflationAggregator.startTrace();
|
||||||
|
inflater.inflate(linearLayout, null);
|
||||||
|
linearInflationAggregator.endTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
textView.setText(
|
||||||
|
yogaInflationAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearInflationAggregator.toString());
|
||||||
|
Log.i(
|
||||||
|
"YogaLayoutBenchmark",
|
||||||
|
yogaInflationAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearInflationAggregator.toString());
|
||||||
|
rootLayout.invalidate();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.facebook.samples.yoga.R;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BenchmarkLayout extends BenchmarkFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(
|
||||||
|
LayoutInflater inflater,
|
||||||
|
ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
|
Button b = (Button) rootLayout.findViewById(R.id.btn);
|
||||||
|
b.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startBenchmark();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return rootLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startBenchmark() {
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
|
TextView textView = (TextView) rootLayout.findViewById(R.id.text);
|
||||||
|
Random random = new Random();
|
||||||
|
|
||||||
|
final int ITERATIONS = 500;
|
||||||
|
|
||||||
|
BenchmarkAggregator yogaInflationAggregator = new BenchmarkAggregator("Yoga Layout");
|
||||||
|
BenchmarkAggregator linearInflationAggregator = new BenchmarkAggregator("Linear Layout");
|
||||||
|
View yogaView = inflater.inflate(yogaLayout, null);
|
||||||
|
View linearView = inflater.inflate(linearLayout, null);
|
||||||
|
for (int i = 0; i < ITERATIONS; i++) {
|
||||||
|
randomizeText(yogaView);
|
||||||
|
randomizeText(linearView);
|
||||||
|
yogaView.measure(
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
|
||||||
|
linearView.measure(
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
|
||||||
|
yogaInflationAggregator.startTrace();
|
||||||
|
yogaView.layout(0, 0, yogaView.getMeasuredWidth(), yogaView.getMeasuredHeight());
|
||||||
|
yogaInflationAggregator.endTrace();
|
||||||
|
linearInflationAggregator.startTrace();
|
||||||
|
linearView.layout(0, 0, linearView.getMeasuredWidth(), linearView.getMeasuredHeight());
|
||||||
|
linearInflationAggregator.endTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
textView.setText(
|
||||||
|
yogaInflationAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearInflationAggregator.toString());
|
||||||
|
Log.i(
|
||||||
|
"YogaLayoutBenchmark",
|
||||||
|
yogaInflationAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearInflationAggregator.toString());
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.facebook.samples.yoga.R;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BenchmarkMeasure extends BenchmarkFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(
|
||||||
|
LayoutInflater inflater,
|
||||||
|
ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
|
Button b = (Button) rootLayout.findViewById(R.id.btn);
|
||||||
|
b.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startBenchmark();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return rootLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startBenchmark() {
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
|
TextView textView = (TextView) rootLayout.findViewById(R.id.text);
|
||||||
|
Random random = new Random();
|
||||||
|
|
||||||
|
final int ITERATIONS = 500;
|
||||||
|
|
||||||
|
BenchmarkAggregator yogaMeasureAggregator = new BenchmarkAggregator("Yoga Measure");
|
||||||
|
BenchmarkAggregator linearMeasureAggregator = new BenchmarkAggregator("Linear Measure");
|
||||||
|
View yogaView = inflater.inflate(yogaLayout, null);
|
||||||
|
View linearView = inflater.inflate(linearLayout, null);
|
||||||
|
for (int i = 0; i < ITERATIONS; i++) {
|
||||||
|
randomizeText(yogaView);
|
||||||
|
randomizeText(linearView);
|
||||||
|
yogaMeasureAggregator.startTrace();
|
||||||
|
yogaView.measure(
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
|
||||||
|
yogaMeasureAggregator.endTrace();
|
||||||
|
linearMeasureAggregator.startTrace();
|
||||||
|
linearView.measure(
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
|
||||||
|
View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
|
||||||
|
linearMeasureAggregator.endTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
textView.setText(
|
||||||
|
yogaMeasureAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearMeasureAggregator.toString());
|
||||||
|
Log.i(
|
||||||
|
"YogaLayoutBenchmark",
|
||||||
|
yogaMeasureAggregator.toString()+
|
||||||
|
"\n"+
|
||||||
|
linearMeasureAggregator.toString());
|
||||||
|
|
||||||
|
yogaMeasureAggregator.dump(getActivity());
|
||||||
|
linearMeasureAggregator.dump(getActivity());
|
||||||
|
}
|
||||||
|
}
|
@@ -1,16 +1,19 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.samples.yoga;
|
package com.facebook.samples.yoga;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.Menu;
|
||||||
|
|
||||||
import com.facebook.samples.yoga.R;
|
import com.facebook.samples.yoga.R;
|
||||||
import com.facebook.soloader.SoLoader;
|
import com.facebook.soloader.SoLoader;
|
||||||
@@ -21,7 +24,7 @@ import com.facebook.yoga.android.YogaViewLayoutFactory;
|
|||||||
* {@code main_layout.xml}) that shows off the awesome functionality of the Yoga layout engine
|
* {@code main_layout.xml}) that shows off the awesome functionality of the Yoga layout engine
|
||||||
* as well as some optimisations on layout systems that it facilitates.
|
* as well as some optimisations on layout systems that it facilitates.
|
||||||
*/
|
*/
|
||||||
public class MainActivity extends ActionBarActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -31,4 +34,20 @@ public class MainActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
setContentView(R.layout.main_layout);
|
setContentView(R.layout.main_layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
inflater.inflate(R.menu.action_bar_home, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// There is only one option
|
||||||
|
Intent intent = new Intent(this, BenchmarkActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
this.finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
50
android/sample/res/layout/benchmark_fragment.xml
Normal file
50
android/sample/res/layout/benchmark_fragment.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<YogaLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:yoga="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/rt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_height="50dp"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Run benchmark"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/benchmarkSelect"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:spinnerMode="dropdown"
|
||||||
|
/>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/preview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
/>
|
||||||
|
</YogaLayout>
|
30
android/sample/res/layout/benchmark_layout_1.xml
Normal file
30
android/sample/res/layout/benchmark_layout_1.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<YogaLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:yoga="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_alignItems="center"
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_flex="0"
|
||||||
|
yoga:yg_marginAll="5dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
yoga:yg_flex="0"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_2_text"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
yoga:yg_marginHorizontal="5dp"
|
||||||
|
/>
|
||||||
|
</YogaLayout>
|
28
android/sample/res/layout/benchmark_layout_1_linear.xml
Normal file
28
android/sample/res/layout/benchmark_layout_1_linear.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:text="@string/child_2_text"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
104
android/sample/res/layout/benchmark_layout_2.xml
Normal file
104
android/sample/res/layout/benchmark_layout_2.xml
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<YogaLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:yoga="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:height="40dp"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginAll="10dp"
|
||||||
|
yoga:yg_aspectRatio="1"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:height="40dp"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
yoga:yg_justifyContent="space_around"
|
||||||
|
>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:height="8dp"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_aspectRatio="1"
|
||||||
|
/>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:height="8dp"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_aspectRatio="1"
|
||||||
|
/>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:height="8dp"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_alignItems="stretch"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_aspectRatio="1"
|
||||||
|
/>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</YogaLayout>
|
96
android/sample/res/layout/benchmark_layout_2_linear.xml
Normal file
96
android/sample/res/layout/benchmark_layout_2_linear.xml
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:yoga="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="8dp"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="8dp"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/child_1_text"
|
||||||
|
android:textSize="5sp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:layout_width="8dp"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
206
android/sample/res/layout/benchmark_layout_3.xml
Normal file
206
android/sample/res/layout/benchmark_layout_3.xml
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<YogaLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:yoga="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_alignItems="center"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_justifyContent="center"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="column"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
yoga:yg_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<VirtualYogaLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
yoga:yg_flexDirection="row"
|
||||||
|
yoga:yg_flex="1"
|
||||||
|
>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</VirtualYogaLayout>
|
||||||
|
</YogaLayout>
|
204
android/sample/res/layout/benchmark_layout_3_linear.xml
Normal file
204
android/sample/res/layout/benchmark_layout_3_linear.xml
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_blue"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:background="@color/yoga_grey"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
7
android/sample/res/layout/benchmark_select_layout.xml
Normal file
7
android/sample/res/layout/benchmark_select_layout.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<android.support.v4.view.ViewPager
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/viewpager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
@@ -18,10 +18,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sample_children_background"
|
android:background="@drawable/sample_children_background"
|
||||||
yoga:yg_margin_horizontal="10dp"
|
yoga:yg_marginHorizontal="10dp"
|
||||||
yoga:yg_margin_top="5dp"
|
yoga:yg_marginTop="5dp"
|
||||||
yoga:yg_flex_direction="row"
|
yoga:yg_flexDirection="row"
|
||||||
yoga:yg_align_items="center"
|
yoga:yg_alignItems="center"
|
||||||
>
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -35,17 +35,17 @@
|
|||||||
android:text="@string/child_1_text"
|
android:text="@string/child_1_text"
|
||||||
android:textColor="@color/children_text"
|
android:textColor="@color/children_text"
|
||||||
yoga:yg_flex="1"
|
yoga:yg_flex="1"
|
||||||
yoga:yg_margin_start="8dp"
|
yoga:yg_marginStart="8dp"
|
||||||
/>
|
/>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
<YogaLayout
|
<YogaLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sample_children_background"
|
android:background="@drawable/sample_children_background"
|
||||||
yoga:yg_margin_horizontal="10dp"
|
yoga:yg_marginHorizontal="10dp"
|
||||||
yoga:yg_margin_top="5dp"
|
yoga:yg_marginTop="5dp"
|
||||||
yoga:yg_flex_direction="row"
|
yoga:yg_flexDirection="row"
|
||||||
yoga:yg_align_items="center"
|
yoga:yg_alignItems="center"
|
||||||
>
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -59,17 +59,17 @@
|
|||||||
android:text="@string/child_2_text"
|
android:text="@string/child_2_text"
|
||||||
android:textColor="@color/children_text"
|
android:textColor="@color/children_text"
|
||||||
yoga:yg_flex="1"
|
yoga:yg_flex="1"
|
||||||
yoga:yg_margin_start="8dp"
|
yoga:yg_marginStart="8dp"
|
||||||
/>
|
/>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
<YogaLayout
|
<YogaLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sample_children_background"
|
android:background="@drawable/sample_children_background"
|
||||||
yoga:yg_margin_horizontal="10dp"
|
yoga:yg_marginHorizontal="10dp"
|
||||||
yoga:yg_margin_top="5dp"
|
yoga:yg_marginTop="5dp"
|
||||||
yoga:yg_flex_direction="row"
|
yoga:yg_flexDirection="row"
|
||||||
yoga:yg_align_items="center"
|
yoga:yg_alignItems="center"
|
||||||
>
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -83,17 +83,17 @@
|
|||||||
android:text="@string/child_3_text"
|
android:text="@string/child_3_text"
|
||||||
android:textColor="@color/children_text"
|
android:textColor="@color/children_text"
|
||||||
yoga:yg_flex="1"
|
yoga:yg_flex="1"
|
||||||
yoga:yg_margin_start="8dp"
|
yoga:yg_marginStart="8dp"
|
||||||
/>
|
/>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
<YogaLayout
|
<YogaLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sample_children_background"
|
android:background="@drawable/sample_children_background"
|
||||||
yoga:yg_margin_horizontal="10dp"
|
yoga:yg_marginHorizontal="10dp"
|
||||||
yoga:yg_margin_top="5dp"
|
yoga:yg_marginTop="5dp"
|
||||||
yoga:yg_flex_direction="row"
|
yoga:yg_flexDirection="row"
|
||||||
yoga:yg_align_items="center"
|
yoga:yg_alignItems="center"
|
||||||
>
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -107,17 +107,17 @@
|
|||||||
android:text="@string/child_4_text"
|
android:text="@string/child_4_text"
|
||||||
android:textColor="@color/children_text"
|
android:textColor="@color/children_text"
|
||||||
yoga:yg_flex="1"
|
yoga:yg_flex="1"
|
||||||
yoga:yg_margin_start="8dp"
|
yoga:yg_marginStart="8dp"
|
||||||
/>
|
/>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
<YogaLayout
|
<YogaLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sample_children_background"
|
android:background="@drawable/sample_children_background"
|
||||||
yoga:yg_margin_horizontal="10dp"
|
yoga:yg_marginHorizontal="10dp"
|
||||||
yoga:yg_margin_top="5dp"
|
yoga:yg_marginTop="5dp"
|
||||||
yoga:yg_flex_direction="row"
|
yoga:yg_flexDirection="row"
|
||||||
yoga:yg_align_items="center"
|
yoga:yg_alignItems="center"
|
||||||
>
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
android:text="@string/child_5_text"
|
android:text="@string/child_5_text"
|
||||||
android:textColor="@color/children_text"
|
android:textColor="@color/children_text"
|
||||||
yoga:yg_flex="1"
|
yoga:yg_flex="1"
|
||||||
yoga:yg_margin_start="10dp"
|
yoga:yg_marginStart="10dp"
|
||||||
/>
|
/>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
</YogaLayout>
|
</YogaLayout>
|
||||||
|
19
android/sample/res/menu/action_bar_benchmark.xml
Normal file
19
android/sample/res/menu/action_bar_benchmark.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright 2014-present, Facebook, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
This source code is licensed under the license found in the
|
||||||
|
LICENSE-examples file in the root directory of this source tree.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_home"
|
||||||
|
android:title="Home"
|
||||||
|
android:showAsAction="always"
|
||||||
|
/>
|
||||||
|
</menu>
|
19
android/sample/res/menu/action_bar_home.xml
Normal file
19
android/sample/res/menu/action_bar_home.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright 2014-present, Facebook, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
This source code is licensed under the license found in the
|
||||||
|
LICENSE-examples file in the root directory of this source tree.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_benchmark"
|
||||||
|
android:title="Benchmark"
|
||||||
|
android:showAsAction="always"
|
||||||
|
/>
|
||||||
|
</menu>
|
@@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||||
|
|
||||||
android_library(
|
yoga_android_library(
|
||||||
name = "android",
|
name = "android",
|
||||||
srcs = glob(["**/*.java"]),
|
srcs = glob(["**/*.java"]),
|
||||||
visibility = [
|
visibility = [
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
@@ -20,6 +18,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
|
import com.facebook.yoga.YogaNodeFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Much like a {@link YogaLayout}, except this class does not render itself (the container) to the
|
* Much like a {@link YogaLayout}, except this class does not render itself (the container) to the
|
||||||
@@ -35,7 +34,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
final private List<View> mChildren = new LinkedList<>();
|
final private List<View> mChildren = new LinkedList<>();
|
||||||
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
|
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
|
||||||
final private YogaNode mYogaNode = new YogaNode();
|
final private YogaNode mYogaNode = YogaNodeFactory.create();
|
||||||
|
|
||||||
public VirtualYogaLayout(Context context) {
|
public VirtualYogaLayout(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -75,7 +74,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
YogaNode node = new YogaNode();
|
YogaNode node = YogaNodeFactory.create();
|
||||||
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
||||||
YogaLayout.applyLayoutParams(lp, node, child);
|
YogaLayout.applyLayoutParams(lp, node, child);
|
||||||
node.setData(child);
|
node.setData(child);
|
||||||
|
@@ -1,17 +1,12 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
@@ -23,8 +18,6 @@ import android.util.SparseArray;
|
|||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.facebook.yoga.android.R;
|
|
||||||
import com.facebook.yoga.YogaAlign;
|
import com.facebook.yoga.YogaAlign;
|
||||||
import com.facebook.yoga.YogaConstants;
|
import com.facebook.yoga.YogaConstants;
|
||||||
import com.facebook.yoga.YogaDirection;
|
import com.facebook.yoga.YogaDirection;
|
||||||
@@ -36,10 +29,12 @@ import com.facebook.yoga.YogaMeasureFunction;
|
|||||||
import com.facebook.yoga.YogaMeasureMode;
|
import com.facebook.yoga.YogaMeasureMode;
|
||||||
import com.facebook.yoga.YogaMeasureOutput;
|
import com.facebook.yoga.YogaMeasureOutput;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
import com.facebook.yoga.YogaNodeAPI;
|
import com.facebook.yoga.YogaNodeFactory;
|
||||||
import com.facebook.yoga.YogaOverflow;
|
import com.facebook.yoga.YogaOverflow;
|
||||||
import com.facebook.yoga.YogaPositionType;
|
import com.facebook.yoga.YogaPositionType;
|
||||||
import com.facebook.yoga.YogaWrap;
|
import com.facebook.yoga.YogaWrap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@code ViewGroup} based on the Yoga layout engine.
|
* A {@code ViewGroup} based on the Yoga layout engine.
|
||||||
@@ -51,15 +46,15 @@ import com.facebook.yoga.YogaWrap;
|
|||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* <YogaLayout
|
* <YogaLayout
|
||||||
* xmlns:android="http://schemas.android.com/apk/res/android"
|
* xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
* xmlns:yoga="http://schemas.android.com/lib/com.facebook.yoga.android"
|
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* yoga:flex_direction="row"
|
* yoga:flex_direction="row"
|
||||||
* yoga:padding_all="10dp"
|
* yoga:padding_all="10dp"
|
||||||
* >
|
* >
|
||||||
* <TextView
|
* <TextView
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* android:text="Hello, World!"
|
* android:text="Hello, World!"
|
||||||
* yoga:flex="1"
|
* yoga:flex="1"
|
||||||
* />
|
* />
|
||||||
@@ -84,21 +79,26 @@ public class YogaLayout extends ViewGroup {
|
|||||||
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
|
|
||||||
mYogaNode = new YogaNode();
|
mYogaNode = YogaNodeFactory.create();
|
||||||
mYogaNodes = new HashMap<>();
|
mYogaNodes = new HashMap<>();
|
||||||
|
|
||||||
mYogaNode.setData(this);
|
mYogaNode.setData(this);
|
||||||
mYogaNode.setMeasureFunction(new ViewMeasureFunction());
|
mYogaNode.setMeasureFunction(new ViewMeasureFunction());
|
||||||
|
|
||||||
final LayoutParams layoutParams = new LayoutParams(context, attrs);
|
LayoutParams layoutParams = null;
|
||||||
|
if (attrs != null) {
|
||||||
|
layoutParams = new LayoutParams(context, attrs);
|
||||||
|
} else {
|
||||||
|
layoutParams = (LayoutParams) generateDefaultLayoutParams();
|
||||||
|
}
|
||||||
applyLayoutParams(layoutParams, mYogaNode, this);
|
applyLayoutParams(layoutParams, mYogaNode, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
YogaNode getYogaNode() {
|
public YogaNode getYogaNode() {
|
||||||
return mYogaNode;
|
return mYogaNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
YogaNode getYogaNodeForView(View view) {
|
public YogaNode getYogaNodeForView(View view) {
|
||||||
return mYogaNodes.get(view);
|
return mYogaNodes.get(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +153,11 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if (child instanceof YogaLayout) {
|
if (child instanceof YogaLayout) {
|
||||||
childNode = ((YogaLayout) child).getYogaNode();
|
childNode = ((YogaLayout) child).getYogaNode();
|
||||||
} else {
|
} else {
|
||||||
childNode = new YogaNode();
|
if(mYogaNodes.containsKey(child)) {
|
||||||
|
childNode = mYogaNodes.get(child);
|
||||||
|
} else {
|
||||||
|
childNode = YogaNodeFactory.create();
|
||||||
|
}
|
||||||
|
|
||||||
childNode.setData(child);
|
childNode.setData(child);
|
||||||
childNode.setMeasureFunction(new ViewMeasureFunction());
|
childNode.setMeasureFunction(new ViewMeasureFunction());
|
||||||
@@ -259,11 +263,11 @@ public class YogaLayout extends ViewGroup {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final YogaNode parent = node.getParent();
|
final YogaNode owner = node.getOwner();
|
||||||
|
|
||||||
for (int i = 0; i < parent.getChildCount(); i++) {
|
for (int i = 0; i < owner.getChildCount(); i++) {
|
||||||
if (parent.getChildAt(i).equals(node)) {
|
if (owner.getChildAt(i).equals(node)) {
|
||||||
parent.removeChildAt(i);
|
owner.removeChildAt(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,10 +282,13 @@ public class YogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
private void applyLayoutRecursive(YogaNode node, float xOffset, float yOffset) {
|
private void applyLayoutRecursive(YogaNode node, float xOffset, float yOffset) {
|
||||||
View view = (View) node.getData();
|
View view = (View) node.getData();
|
||||||
|
|
||||||
if (view != null && view != this) {
|
if (view != null && view != this) {
|
||||||
if (view.getVisibility() == GONE) {
|
if (view.getVisibility() == GONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int left = Math.round(xOffset + node.getLayoutX());
|
||||||
|
int top = Math.round(yOffset + node.getLayoutY());
|
||||||
view.measure(
|
view.measure(
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutWidth()),
|
Math.round(node.getLayoutWidth()),
|
||||||
@@ -289,11 +296,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutHeight()),
|
Math.round(node.getLayoutHeight()),
|
||||||
View.MeasureSpec.EXACTLY));
|
View.MeasureSpec.EXACTLY));
|
||||||
view.layout(
|
view.layout(left, top, left + view.getMeasuredWidth(), top + view.getMeasuredHeight());
|
||||||
Math.round(xOffset + node.getLayoutX()),
|
|
||||||
Math.round(yOffset + node.getLayoutY()),
|
|
||||||
Math.round(xOffset + node.getLayoutX() + node.getLayoutWidth()),
|
|
||||||
Math.round(yOffset + node.getLayoutY() + node.getLayoutHeight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final int childrenCount = node.getChildCount();
|
final int childrenCount = node.getChildCount();
|
||||||
@@ -313,7 +316,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
// Either we are a root of a tree, or this function is called by our parent's onLayout, in which
|
// Either we are a root of a tree, or this function is called by our owner's onLayout, in which
|
||||||
// case our r-l and b-t are the size of our node.
|
// case our r-l and b-t are the size of our node.
|
||||||
if (!(getParent() instanceof YogaLayout)) {
|
if (!(getParent() instanceof YogaLayout)) {
|
||||||
createLayout(
|
createLayout(
|
||||||
@@ -360,7 +363,6 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if (widthMode == MeasureSpec.AT_MOST) {
|
if (widthMode == MeasureSpec.AT_MOST) {
|
||||||
mYogaNode.setMaxWidth(widthSize);
|
mYogaNode.setMaxWidth(widthSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
mYogaNode.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
|
mYogaNode.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,31 +405,31 @@ public class YogaLayout extends ViewGroup {
|
|||||||
final int attribute = layoutParameters.numericAttributes.keyAt(i);
|
final int attribute = layoutParameters.numericAttributes.keyAt(i);
|
||||||
final float value = layoutParameters.numericAttributes.valueAt(i);
|
final float value = layoutParameters.numericAttributes.valueAt(i);
|
||||||
|
|
||||||
if (attribute == R.styleable.yoga_yg_align_content) {
|
if (attribute == R.styleable.yoga_yg_alignContent) {
|
||||||
node.setAlignContent(YogaAlign.fromInt(Math.round(value)));
|
node.setAlignContent(YogaAlign.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_align_items) {
|
} else if (attribute == R.styleable.yoga_yg_alignItems) {
|
||||||
node.setAlignItems(YogaAlign.fromInt(Math.round(value)));
|
node.setAlignItems(YogaAlign.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_align_self) {
|
} else if (attribute == R.styleable.yoga_yg_alignSelf) {
|
||||||
node.setAlignSelf(YogaAlign.fromInt(Math.round(value)));
|
node.setAlignSelf(YogaAlign.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_aspect_ratio) {
|
} else if (attribute == R.styleable.yoga_yg_aspectRatio) {
|
||||||
node.setAspectRatio(value);
|
node.setAspectRatio(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_left) {
|
} else if (attribute == R.styleable.yoga_yg_borderLeft) {
|
||||||
node.setBorder(YogaEdge.LEFT, value);
|
node.setBorder(YogaEdge.LEFT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_top) {
|
} else if (attribute == R.styleable.yoga_yg_borderTop) {
|
||||||
node.setBorder(YogaEdge.TOP, value);
|
node.setBorder(YogaEdge.TOP, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_right) {
|
} else if (attribute == R.styleable.yoga_yg_borderRight) {
|
||||||
node.setBorder(YogaEdge.RIGHT, value);
|
node.setBorder(YogaEdge.RIGHT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_borderBottom) {
|
||||||
node.setBorder(YogaEdge.BOTTOM, value);
|
node.setBorder(YogaEdge.BOTTOM, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_start) {
|
} else if (attribute == R.styleable.yoga_yg_borderStart) {
|
||||||
node.setBorder(YogaEdge.START, value);
|
node.setBorder(YogaEdge.START, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_end) {
|
} else if (attribute == R.styleable.yoga_yg_borderEnd) {
|
||||||
node.setBorder(YogaEdge.END, value);
|
node.setBorder(YogaEdge.END, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_borderHorizontal) {
|
||||||
node.setBorder(YogaEdge.HORIZONTAL, value);
|
node.setBorder(YogaEdge.HORIZONTAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_borderVertical) {
|
||||||
node.setBorder(YogaEdge.VERTICAL, value);
|
node.setBorder(YogaEdge.VERTICAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_border_all) {
|
} else if (attribute == R.styleable.yoga_yg_borderAll) {
|
||||||
node.setBorder(YogaEdge.ALL, value);
|
node.setBorder(YogaEdge.ALL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_direction) {
|
} else if (attribute == R.styleable.yoga_yg_direction) {
|
||||||
node.setDirection(YogaDirection.fromInt(Math.round(value)));
|
node.setDirection(YogaDirection.fromInt(Math.round(value)));
|
||||||
@@ -435,83 +437,83 @@ public class YogaLayout extends ViewGroup {
|
|||||||
node.setDisplay(YogaDisplay.fromInt(Math.round(value)));
|
node.setDisplay(YogaDisplay.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_flex) {
|
} else if (attribute == R.styleable.yoga_yg_flex) {
|
||||||
node.setFlex(value);
|
node.setFlex(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_flex_basis) {
|
} else if (attribute == R.styleable.yoga_yg_flexBasis) {
|
||||||
node.setFlexBasis(value);
|
node.setFlexBasis(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_flex_direction) {
|
} else if (attribute == R.styleable.yoga_yg_flexDirection) {
|
||||||
node.setFlexDirection(YogaFlexDirection.fromInt(Math.round(value)));
|
node.setFlexDirection(YogaFlexDirection.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_flex_grow) {
|
} else if (attribute == R.styleable.yoga_yg_flexGrow) {
|
||||||
node.setFlexGrow(value);
|
node.setFlexGrow(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_flex_shrink) {
|
} else if (attribute == R.styleable.yoga_yg_flexShrink) {
|
||||||
node.setFlexShrink(value);
|
node.setFlexShrink(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_height) {
|
} else if (attribute == R.styleable.yoga_yg_height) {
|
||||||
node.setHeight(value);
|
node.setHeight(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_left) {
|
} else if (attribute == R.styleable.yoga_yg_marginLeft) {
|
||||||
node.setMargin(YogaEdge.LEFT, value);
|
node.setMargin(YogaEdge.LEFT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_justify_content) {
|
} else if (attribute == R.styleable.yoga_yg_justifyContent) {
|
||||||
node.setJustifyContent(YogaJustify.fromInt(Math.round(value)));
|
node.setJustifyContent(YogaJustify.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_top) {
|
} else if (attribute == R.styleable.yoga_yg_marginTop) {
|
||||||
node.setMargin(YogaEdge.TOP, value);
|
node.setMargin(YogaEdge.TOP, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_right) {
|
} else if (attribute == R.styleable.yoga_yg_marginRight) {
|
||||||
node.setMargin(YogaEdge.RIGHT, value);
|
node.setMargin(YogaEdge.RIGHT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_marginBottom) {
|
||||||
node.setMargin(YogaEdge.BOTTOM, value);
|
node.setMargin(YogaEdge.BOTTOM, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_start) {
|
} else if (attribute == R.styleable.yoga_yg_marginStart) {
|
||||||
node.setMargin(YogaEdge.START, value);
|
node.setMargin(YogaEdge.START, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_end) {
|
} else if (attribute == R.styleable.yoga_yg_marginEnd) {
|
||||||
node.setMargin(YogaEdge.END, value);
|
node.setMargin(YogaEdge.END, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_marginHorizontal) {
|
||||||
node.setMargin(YogaEdge.HORIZONTAL, value);
|
node.setMargin(YogaEdge.HORIZONTAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_marginVertical) {
|
||||||
node.setMargin(YogaEdge.VERTICAL, value);
|
node.setMargin(YogaEdge.VERTICAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_all) {
|
} else if (attribute == R.styleable.yoga_yg_marginAll) {
|
||||||
node.setMargin(YogaEdge.ALL, value);
|
node.setMargin(YogaEdge.ALL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_max_height) {
|
} else if (attribute == R.styleable.yoga_yg_maxHeight) {
|
||||||
node.setMaxHeight(value);
|
node.setMaxHeight(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_max_width) {
|
} else if (attribute == R.styleable.yoga_yg_maxWidth) {
|
||||||
node.setMaxWidth(value);
|
node.setMaxWidth(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_min_height) {
|
} else if (attribute == R.styleable.yoga_yg_minHeight) {
|
||||||
node.setMinHeight(value);
|
node.setMinHeight(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_min_width) {
|
} else if (attribute == R.styleable.yoga_yg_minWidth) {
|
||||||
node.setMinWidth(value);
|
node.setMinWidth(value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_overflow) {
|
} else if (attribute == R.styleable.yoga_yg_overflow) {
|
||||||
node.setOverflow(YogaOverflow.fromInt(Math.round(value)));
|
node.setOverflow(YogaOverflow.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_left) {
|
} else if (attribute == R.styleable.yoga_yg_paddingLeft) {
|
||||||
node.setPadding(YogaEdge.LEFT, value);
|
node.setPadding(YogaEdge.LEFT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_top) {
|
} else if (attribute == R.styleable.yoga_yg_paddingTop) {
|
||||||
node.setPadding(YogaEdge.TOP, value);
|
node.setPadding(YogaEdge.TOP, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_right) {
|
} else if (attribute == R.styleable.yoga_yg_paddingRight) {
|
||||||
node.setPadding(YogaEdge.RIGHT, value);
|
node.setPadding(YogaEdge.RIGHT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_paddingBottom) {
|
||||||
node.setPadding(YogaEdge.BOTTOM, value);
|
node.setPadding(YogaEdge.BOTTOM, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_start) {
|
} else if (attribute == R.styleable.yoga_yg_paddingStart) {
|
||||||
node.setPadding(YogaEdge.START, value);
|
node.setPadding(YogaEdge.START, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_end) {
|
} else if (attribute == R.styleable.yoga_yg_paddingEnd) {
|
||||||
node.setPadding(YogaEdge.END, value);
|
node.setPadding(YogaEdge.END, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_paddingHorizontal) {
|
||||||
node.setPadding(YogaEdge.HORIZONTAL, value);
|
node.setPadding(YogaEdge.HORIZONTAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_paddingVertical) {
|
||||||
node.setPadding(YogaEdge.VERTICAL, value);
|
node.setPadding(YogaEdge.VERTICAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_all) {
|
} else if (attribute == R.styleable.yoga_yg_paddingAll) {
|
||||||
node.setPadding(YogaEdge.ALL, value);
|
node.setPadding(YogaEdge.ALL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_left) {
|
} else if (attribute == R.styleable.yoga_yg_positionLeft) {
|
||||||
node.setPosition(YogaEdge.LEFT, value);
|
node.setPosition(YogaEdge.LEFT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_top) {
|
} else if (attribute == R.styleable.yoga_yg_positionTop) {
|
||||||
node.setPosition(YogaEdge.TOP, value);
|
node.setPosition(YogaEdge.TOP, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_right) {
|
} else if (attribute == R.styleable.yoga_yg_positionRight) {
|
||||||
node.setPosition(YogaEdge.RIGHT, value);
|
node.setPosition(YogaEdge.RIGHT, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_positionBottom) {
|
||||||
node.setPosition(YogaEdge.BOTTOM, value);
|
node.setPosition(YogaEdge.BOTTOM, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_start) {
|
} else if (attribute == R.styleable.yoga_yg_positionStart) {
|
||||||
node.setPosition(YogaEdge.START, value);
|
node.setPosition(YogaEdge.START, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_end) {
|
} else if (attribute == R.styleable.yoga_yg_positionEnd) {
|
||||||
node.setPosition(YogaEdge.END, value);
|
node.setPosition(YogaEdge.END, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_positionHorizontal) {
|
||||||
node.setPosition(YogaEdge.HORIZONTAL, value);
|
node.setPosition(YogaEdge.HORIZONTAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_positionVertical) {
|
||||||
node.setPosition(YogaEdge.VERTICAL, value);
|
node.setPosition(YogaEdge.VERTICAL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_all) {
|
} else if (attribute == R.styleable.yoga_yg_positionAll) {
|
||||||
node.setPosition(YogaEdge.ALL, value);
|
node.setPosition(YogaEdge.ALL, value);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_type) {
|
} else if (attribute == R.styleable.yoga_yg_positionType) {
|
||||||
node.setPositionType(YogaPositionType.fromInt(Math.round(value)));
|
node.setPositionType(YogaPositionType.fromInt(Math.round(value)));
|
||||||
} else if (attribute == R.styleable.yoga_yg_width) {
|
} else if (attribute == R.styleable.yoga_yg_width) {
|
||||||
node.setWidth(value);
|
node.setWidth(value);
|
||||||
@@ -525,23 +527,23 @@ public class YogaLayout extends ViewGroup {
|
|||||||
final String value = layoutParameters.stringAttributes.valueAt(i);
|
final String value = layoutParameters.stringAttributes.valueAt(i);
|
||||||
|
|
||||||
if (value.equals("auto")) {
|
if (value.equals("auto")) {
|
||||||
if (attribute == R.styleable.yoga_yg_margin_left) {
|
if (attribute == R.styleable.yoga_yg_marginLeft) {
|
||||||
node.setMarginAuto(YogaEdge.LEFT);
|
node.setMarginAuto(YogaEdge.LEFT);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_top) {
|
} else if (attribute == R.styleable.yoga_yg_marginTop) {
|
||||||
node.setMarginAuto(YogaEdge.TOP);
|
node.setMarginAuto(YogaEdge.TOP);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_right) {
|
} else if (attribute == R.styleable.yoga_yg_marginRight) {
|
||||||
node.setMarginAuto(YogaEdge.RIGHT);
|
node.setMarginAuto(YogaEdge.RIGHT);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_marginBottom) {
|
||||||
node.setMarginAuto(YogaEdge.BOTTOM);
|
node.setMarginAuto(YogaEdge.BOTTOM);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_start) {
|
} else if (attribute == R.styleable.yoga_yg_marginStart) {
|
||||||
node.setMarginAuto(YogaEdge.START);
|
node.setMarginAuto(YogaEdge.START);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_end) {
|
} else if (attribute == R.styleable.yoga_yg_marginEnd) {
|
||||||
node.setMarginAuto(YogaEdge.END);
|
node.setMarginAuto(YogaEdge.END);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_marginHorizontal) {
|
||||||
node.setMarginAuto(YogaEdge.HORIZONTAL);
|
node.setMarginAuto(YogaEdge.HORIZONTAL);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_marginVertical) {
|
||||||
node.setMarginAuto(YogaEdge.VERTICAL);
|
node.setMarginAuto(YogaEdge.VERTICAL);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_all) {
|
} else if (attribute == R.styleable.yoga_yg_marginAll) {
|
||||||
node.setMarginAuto(YogaEdge.ALL);
|
node.setMarginAuto(YogaEdge.ALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -549,71 +551,71 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if (value.endsWith("%")) {
|
if (value.endsWith("%")) {
|
||||||
final float numericValue = Float.parseFloat(value.substring(0, value.length()-1));
|
final float numericValue = Float.parseFloat(value.substring(0, value.length()-1));
|
||||||
|
|
||||||
if (attribute == R.styleable.yoga_yg_flex_basis) {
|
if (attribute == R.styleable.yoga_yg_flexBasis) {
|
||||||
node.setFlexBasisPercent(numericValue);
|
node.setFlexBasisPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_height) {
|
} else if (attribute == R.styleable.yoga_yg_height) {
|
||||||
node.setHeightPercent(numericValue);
|
node.setHeightPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_left) {
|
} else if (attribute == R.styleable.yoga_yg_marginLeft) {
|
||||||
node.setMarginPercent(YogaEdge.LEFT, numericValue);
|
node.setMarginPercent(YogaEdge.LEFT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_top) {
|
} else if (attribute == R.styleable.yoga_yg_marginTop) {
|
||||||
node.setMarginPercent(YogaEdge.TOP, numericValue);
|
node.setMarginPercent(YogaEdge.TOP, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_right) {
|
} else if (attribute == R.styleable.yoga_yg_marginRight) {
|
||||||
node.setMarginPercent(YogaEdge.RIGHT, numericValue);
|
node.setMarginPercent(YogaEdge.RIGHT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_marginBottom) {
|
||||||
node.setMarginPercent(YogaEdge.BOTTOM, numericValue);
|
node.setMarginPercent(YogaEdge.BOTTOM, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_start) {
|
} else if (attribute == R.styleable.yoga_yg_marginStart) {
|
||||||
node.setMarginPercent(YogaEdge.START, numericValue);
|
node.setMarginPercent(YogaEdge.START, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_end) {
|
} else if (attribute == R.styleable.yoga_yg_marginEnd) {
|
||||||
node.setMarginPercent(YogaEdge.END, numericValue);
|
node.setMarginPercent(YogaEdge.END, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_marginHorizontal) {
|
||||||
node.setMarginPercent(YogaEdge.HORIZONTAL, numericValue);
|
node.setMarginPercent(YogaEdge.HORIZONTAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_marginVertical) {
|
||||||
node.setMarginPercent(YogaEdge.VERTICAL, numericValue);
|
node.setMarginPercent(YogaEdge.VERTICAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_margin_all) {
|
} else if (attribute == R.styleable.yoga_yg_marginAll) {
|
||||||
node.setMarginPercent(YogaEdge.ALL, numericValue);
|
node.setMarginPercent(YogaEdge.ALL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_max_height) {
|
} else if (attribute == R.styleable.yoga_yg_maxHeight) {
|
||||||
node.setMaxHeightPercent(numericValue);
|
node.setMaxHeightPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_max_width) {
|
} else if (attribute == R.styleable.yoga_yg_maxWidth) {
|
||||||
node.setMaxWidthPercent(numericValue);
|
node.setMaxWidthPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_min_height) {
|
} else if (attribute == R.styleable.yoga_yg_minHeight) {
|
||||||
node.setMinHeightPercent(numericValue);
|
node.setMinHeightPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_min_width) {
|
} else if (attribute == R.styleable.yoga_yg_minWidth) {
|
||||||
node.setMinWidthPercent(numericValue);
|
node.setMinWidthPercent(numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_left) {
|
} else if (attribute == R.styleable.yoga_yg_paddingLeft) {
|
||||||
node.setPaddingPercent(YogaEdge.LEFT, numericValue);
|
node.setPaddingPercent(YogaEdge.LEFT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_top) {
|
} else if (attribute == R.styleable.yoga_yg_paddingTop) {
|
||||||
node.setPaddingPercent(YogaEdge.TOP, numericValue);
|
node.setPaddingPercent(YogaEdge.TOP, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_right) {
|
} else if (attribute == R.styleable.yoga_yg_paddingRight) {
|
||||||
node.setPaddingPercent(YogaEdge.RIGHT, numericValue);
|
node.setPaddingPercent(YogaEdge.RIGHT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_paddingBottom) {
|
||||||
node.setPaddingPercent(YogaEdge.BOTTOM, numericValue);
|
node.setPaddingPercent(YogaEdge.BOTTOM, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_start) {
|
} else if (attribute == R.styleable.yoga_yg_paddingStart) {
|
||||||
node.setPaddingPercent(YogaEdge.START, numericValue);
|
node.setPaddingPercent(YogaEdge.START, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_end) {
|
} else if (attribute == R.styleable.yoga_yg_paddingEnd) {
|
||||||
node.setPaddingPercent(YogaEdge.END, numericValue);
|
node.setPaddingPercent(YogaEdge.END, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_paddingHorizontal) {
|
||||||
node.setPaddingPercent(YogaEdge.HORIZONTAL, numericValue);
|
node.setPaddingPercent(YogaEdge.HORIZONTAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_paddingVertical) {
|
||||||
node.setPaddingPercent(YogaEdge.VERTICAL, numericValue);
|
node.setPaddingPercent(YogaEdge.VERTICAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_padding_all) {
|
} else if (attribute == R.styleable.yoga_yg_paddingAll) {
|
||||||
node.setPaddingPercent(YogaEdge.ALL, numericValue);
|
node.setPaddingPercent(YogaEdge.ALL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_left) {
|
} else if (attribute == R.styleable.yoga_yg_positionLeft) {
|
||||||
node.setPositionPercent(YogaEdge.LEFT, numericValue);
|
node.setPositionPercent(YogaEdge.LEFT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_top) {
|
} else if (attribute == R.styleable.yoga_yg_positionTop) {
|
||||||
node.setPositionPercent(YogaEdge.TOP, numericValue);
|
node.setPositionPercent(YogaEdge.TOP, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_right) {
|
} else if (attribute == R.styleable.yoga_yg_positionRight) {
|
||||||
node.setPositionPercent(YogaEdge.RIGHT, numericValue);
|
node.setPositionPercent(YogaEdge.RIGHT, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_bottom) {
|
} else if (attribute == R.styleable.yoga_yg_positionBottom) {
|
||||||
node.setPositionPercent(YogaEdge.BOTTOM, numericValue);
|
node.setPositionPercent(YogaEdge.BOTTOM, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_start) {
|
} else if (attribute == R.styleable.yoga_yg_positionStart) {
|
||||||
node.setPositionPercent(YogaEdge.START, numericValue);
|
node.setPositionPercent(YogaEdge.START, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_end) {
|
} else if (attribute == R.styleable.yoga_yg_positionEnd) {
|
||||||
node.setPositionPercent(YogaEdge.END, numericValue);
|
node.setPositionPercent(YogaEdge.END, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_horizontal) {
|
} else if (attribute == R.styleable.yoga_yg_positionHorizontal) {
|
||||||
node.setPositionPercent(YogaEdge.HORIZONTAL, numericValue);
|
node.setPositionPercent(YogaEdge.HORIZONTAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_vertical) {
|
} else if (attribute == R.styleable.yoga_yg_positionVertical) {
|
||||||
node.setPositionPercent(YogaEdge.VERTICAL, numericValue);
|
node.setPositionPercent(YogaEdge.VERTICAL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_position_all) {
|
} else if (attribute == R.styleable.yoga_yg_positionAll) {
|
||||||
node.setPositionPercent(YogaEdge.ALL, numericValue);
|
node.setPositionPercent(YogaEdge.ALL, numericValue);
|
||||||
} else if (attribute == R.styleable.yoga_yg_width) {
|
} else if (attribute == R.styleable.yoga_yg_width) {
|
||||||
node.setWidthPercent(numericValue);
|
node.setWidthPercent(numericValue);
|
||||||
@@ -698,7 +700,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
/**
|
/**
|
||||||
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
||||||
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
||||||
* options (such as {@code match_parent} or {@code wrap_content} are given, then the parent
|
* options (such as {@code match_owner} or {@code wrap_content} are given, then the owner
|
||||||
* LayoutParams will store them, and we deal with them during layout. (see
|
* LayoutParams will store them, and we deal with them during layout. (see
|
||||||
* {@link YogaLayout#createLayout})
|
* {@link YogaLayout#createLayout})
|
||||||
*
|
*
|
||||||
@@ -772,14 +774,14 @@ public class YogaLayout extends ViewGroup {
|
|||||||
* {@code View}'s measure function.
|
* {@code View}'s measure function.
|
||||||
*
|
*
|
||||||
* @param node The yoga node to measure
|
* @param node The yoga node to measure
|
||||||
* @param width The suggested width from the parent
|
* @param width The suggested width from the owner
|
||||||
* @param widthMode The type of suggestion for the width
|
* @param widthMode The type of suggestion for the width
|
||||||
* @param height The suggested height from the parent
|
* @param height The suggested height from the owner
|
||||||
* @param heightMode The type of suggestion for the height
|
* @param heightMode The type of suggestion for the height
|
||||||
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
||||||
*/
|
*/
|
||||||
public long measure(
|
public long measure(
|
||||||
YogaNodeAPI node,
|
YogaNode node,
|
||||||
float width,
|
float width,
|
||||||
YogaMeasureMode widthMode,
|
YogaMeasureMode widthMode,
|
||||||
float height,
|
float height,
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
@@ -1,18 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<declare-styleable name="yoga">
|
<declare-styleable name="yoga">
|
||||||
|
|
||||||
<attr name="yg_align_content" format="enum">
|
<attr name="yg_alignContent" format="enum">
|
||||||
<enum name="auto" value="0"/>
|
<enum name="auto" value="0"/>
|
||||||
<enum name="flex_start" value="1"/>
|
<enum name="flex_start" value="1"/>
|
||||||
<enum name="center" value="2"/>
|
<enum name="center" value="2"/>
|
||||||
@@ -21,7 +19,7 @@
|
|||||||
<enum name="baseline" value="5"/>
|
<enum name="baseline" value="5"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_align_items" format="enum">
|
<attr name="yg_alignItems" format="enum">
|
||||||
<enum name="auto" value="0"/>
|
<enum name="auto" value="0"/>
|
||||||
<enum name="flex_start" value="1"/>
|
<enum name="flex_start" value="1"/>
|
||||||
<enum name="center" value="2"/>
|
<enum name="center" value="2"/>
|
||||||
@@ -30,7 +28,7 @@
|
|||||||
<enum name="baseline" value="5"/>
|
<enum name="baseline" value="5"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_align_self" format="enum">
|
<attr name="yg_alignSelf" format="enum">
|
||||||
<enum name="auto" value="0"/>
|
<enum name="auto" value="0"/>
|
||||||
<enum name="flex_start" value="1"/>
|
<enum name="flex_start" value="1"/>
|
||||||
<enum name="center" value="2"/>
|
<enum name="center" value="2"/>
|
||||||
@@ -39,17 +37,17 @@
|
|||||||
<enum name="baseline" value="5"/>
|
<enum name="baseline" value="5"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_aspect_ratio" format="float"/>
|
<attr name="yg_aspectRatio" format="float"/>
|
||||||
|
|
||||||
<attr name="yg_border_left" format="dimension"/>
|
<attr name="yg_borderLeft" format="dimension"/>
|
||||||
<attr name="yg_border_top" format="dimension"/>
|
<attr name="yg_borderTop" format="dimension"/>
|
||||||
<attr name="yg_border_right" format="dimension"/>
|
<attr name="yg_borderRight" format="dimension"/>
|
||||||
<attr name="yg_border_bottom" format="dimension"/>
|
<attr name="yg_borderBottom" format="dimension"/>
|
||||||
<attr name="yg_border_start" format="dimension"/>
|
<attr name="yg_borderStart" format="dimension"/>
|
||||||
<attr name="yg_border_end" format="dimension"/>
|
<attr name="yg_borderEnd" format="dimension"/>
|
||||||
<attr name="yg_border_horizontal" format="dimension"/>
|
<attr name="yg_borderHorizontal" format="dimension"/>
|
||||||
<attr name="yg_border_vertical" format="dimension"/>
|
<attr name="yg_borderVertical" format="dimension"/>
|
||||||
<attr name="yg_border_all" format="dimension"/>
|
<attr name="yg_borderAll" format="dimension"/>
|
||||||
|
|
||||||
<attr name="yg_direction" format="enum">
|
<attr name="yg_direction" format="enum">
|
||||||
<enum name="inherit" value="0"/>
|
<enum name="inherit" value="0"/>
|
||||||
@@ -64,22 +62,22 @@
|
|||||||
|
|
||||||
<attr name="yg_flex" format="float"/>
|
<attr name="yg_flex" format="float"/>
|
||||||
|
|
||||||
<attr name="yg_flex_basis" format="float|string"/>
|
<attr name="yg_flexBasis" format="float|string"/>
|
||||||
|
|
||||||
<attr name="yg_flex_direction" format="enum">
|
<attr name="yg_flexDirection" format="enum">
|
||||||
<enum name="column" value="0"/>
|
<enum name="column" value="0"/>
|
||||||
<enum name="column_reverse" value="1"/>
|
<enum name="column_reverse" value="1"/>
|
||||||
<enum name="row" value="2"/>
|
<enum name="row" value="2"/>
|
||||||
<enum name="row_reverse" value="3"/>
|
<enum name="row_reverse" value="3"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_flex_grow" format="float"/>
|
<attr name="yg_flexGrow" format="float"/>
|
||||||
|
|
||||||
<attr name="yg_flex_shrink" format="float"/>
|
<attr name="yg_flexShrink" format="float"/>
|
||||||
|
|
||||||
<attr name="yg_height" format="dimension|string"/>
|
<attr name="yg_height" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_justify_content" format="enum">
|
<attr name="yg_justifyContent" format="enum">
|
||||||
<enum name="flex_start" value="0"/>
|
<enum name="flex_start" value="0"/>
|
||||||
<enum name="center" value="1"/>
|
<enum name="center" value="1"/>
|
||||||
<enum name="flex_end" value="2"/>
|
<enum name="flex_end" value="2"/>
|
||||||
@@ -87,23 +85,23 @@
|
|||||||
<enum name="space_around" value="4"/>
|
<enum name="space_around" value="4"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_margin_left" format="dimension|string"/>
|
<attr name="yg_marginLeft" format="dimension|string"/>
|
||||||
<attr name="yg_margin_top" format="dimension|string"/>
|
<attr name="yg_marginTop" format="dimension|string"/>
|
||||||
<attr name="yg_margin_right" format="dimension|string"/>
|
<attr name="yg_marginRight" format="dimension|string"/>
|
||||||
<attr name="yg_margin_bottom" format="dimension|string"/>
|
<attr name="yg_marginBottom" format="dimension|string"/>
|
||||||
<attr name="yg_margin_start" format="dimension|string"/>
|
<attr name="yg_marginStart" format="dimension|string"/>
|
||||||
<attr name="yg_margin_end" format="dimension|string"/>
|
<attr name="yg_marginEnd" format="dimension|string"/>
|
||||||
<attr name="yg_margin_horizontal" format="dimension|string"/>
|
<attr name="yg_marginHorizontal" format="dimension|string"/>
|
||||||
<attr name="yg_margin_vertical" format="dimension|string"/>
|
<attr name="yg_marginVertical" format="dimension|string"/>
|
||||||
<attr name="yg_margin_all" format="dimension|string"/>
|
<attr name="yg_marginAll" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_max_height" format="dimension|string"/>
|
<attr name="yg_maxHeight" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_max_width" format="dimension|string"/>
|
<attr name="yg_maxWidth" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_min_height" format="dimension|string"/>
|
<attr name="yg_minHeight" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_min_width" format="dimension|string"/>
|
<attr name="yg_minWidth" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_overflow" format="enum">
|
<attr name="yg_overflow" format="enum">
|
||||||
<enum name="visible" value="0"/>
|
<enum name="visible" value="0"/>
|
||||||
@@ -111,27 +109,27 @@
|
|||||||
<enum name="scroll" value="2"/>
|
<enum name="scroll" value="2"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<attr name="yg_padding_left" format="dimension|string"/>
|
<attr name="yg_paddingLeft" format="dimension|string"/>
|
||||||
<attr name="yg_padding_top" format="dimension|string"/>
|
<attr name="yg_paddingTop" format="dimension|string"/>
|
||||||
<attr name="yg_padding_right" format="dimension|string"/>
|
<attr name="yg_paddingRight" format="dimension|string"/>
|
||||||
<attr name="yg_padding_bottom" format="dimension|string"/>
|
<attr name="yg_paddingBottom" format="dimension|string"/>
|
||||||
<attr name="yg_padding_start" format="dimension|string"/>
|
<attr name="yg_paddingStart" format="dimension|string"/>
|
||||||
<attr name="yg_padding_end" format="dimension|string"/>
|
<attr name="yg_paddingEnd" format="dimension|string"/>
|
||||||
<attr name="yg_padding_horizontal" format="dimension|string"/>
|
<attr name="yg_paddingHorizontal" format="dimension|string"/>
|
||||||
<attr name="yg_padding_vertical" format="dimension|string"/>
|
<attr name="yg_paddingVertical" format="dimension|string"/>
|
||||||
<attr name="yg_padding_all" format="dimension|string"/>
|
<attr name="yg_paddingAll" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_position_left" format="dimension|string"/>
|
<attr name="yg_positionLeft" format="dimension|string"/>
|
||||||
<attr name="yg_position_top" format="dimension|string"/>
|
<attr name="yg_positionTop" format="dimension|string"/>
|
||||||
<attr name="yg_position_right" format="dimension|string"/>
|
<attr name="yg_positionRight" format="dimension|string"/>
|
||||||
<attr name="yg_position_bottom" format="dimension|string"/>
|
<attr name="yg_positionBottom" format="dimension|string"/>
|
||||||
<attr name="yg_position_start" format="dimension|string"/>
|
<attr name="yg_positionStart" format="dimension|string"/>
|
||||||
<attr name="yg_position_end" format="dimension|string"/>
|
<attr name="yg_positionEnd" format="dimension|string"/>
|
||||||
<attr name="yg_position_horizontal" format="dimension|string"/>
|
<attr name="yg_positionHorizontal" format="dimension|string"/>
|
||||||
<attr name="yg_position_vertical" format="dimension|string"/>
|
<attr name="yg_positionVertical" format="dimension|string"/>
|
||||||
<attr name="yg_position_all" format="dimension|string"/>
|
<attr name="yg_positionAll" format="dimension|string"/>
|
||||||
|
|
||||||
<attr name="yg_position_type" format="enum">
|
<attr name="yg_positionType" format="enum">
|
||||||
<enum name="relative" value="0"/>
|
<enum name="relative" value="0"/>
|
||||||
<enum name="absolute" value="1"/>
|
<enum name="absolute" value="1"/>
|
||||||
</attr>
|
</attr>
|
||||||
|
@@ -1,15 +1,14 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_cxx_binary", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
yoga_cxx_binary(
|
||||||
|
|
||||||
cxx_binary(
|
|
||||||
name = "benchmark",
|
name = "benchmark",
|
||||||
srcs = glob(["*.c"]),
|
srcs = glob(["*.c"]),
|
||||||
|
headers = subdir_glob([("", "*.h")]),
|
||||||
|
header_namespace = "",
|
||||||
compiler_flags = [
|
compiler_flags = [
|
||||||
"-fno-omit-frame-pointer",
|
"-fno-omit-frame-pointer",
|
||||||
"-fexceptions",
|
"-fexceptions",
|
||||||
@@ -18,8 +17,6 @@ cxx_binary(
|
|||||||
"-O3",
|
"-O3",
|
||||||
"-std=c11",
|
"-std=c11",
|
||||||
],
|
],
|
||||||
header_namespace = "",
|
|
||||||
headers = subdir_glob([("", "*.h")]),
|
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [
|
deps = [
|
||||||
yoga_dep(":yoga"),
|
yoga_dep(":yoga"),
|
||||||
|
@@ -1,21 +1,83 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "YGBenchmark.h"
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <yoga/Yoga.h>
|
#include <yoga/Yoga.h>
|
||||||
|
|
||||||
static YGSize _measure(YGNodeRef node,
|
#define NUM_REPETITIONS 1000
|
||||||
float width,
|
|
||||||
YGMeasureMode widthMode,
|
#define YGBENCHMARKS(BLOCK) \
|
||||||
float height,
|
int main(int argc, char const* argv[]) { \
|
||||||
YGMeasureMode heightMode) {
|
clock_t __start; \
|
||||||
|
clock_t __endTimes[NUM_REPETITIONS]; \
|
||||||
|
{ BLOCK } \
|
||||||
|
return 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define YGBENCHMARK(NAME, BLOCK) \
|
||||||
|
__start = clock(); \
|
||||||
|
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
||||||
|
{BLOCK} __endTimes[__i] = clock(); \
|
||||||
|
} \
|
||||||
|
__printBenchmarkResult(NAME, __start, __endTimes);
|
||||||
|
|
||||||
|
static int __compareDoubles(const void* a, const void* b) {
|
||||||
|
double arg1 = *(const double*) a;
|
||||||
|
double arg2 = *(const double*) b;
|
||||||
|
|
||||||
|
if (arg1 < arg2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg1 > arg2) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __printBenchmarkResult(
|
||||||
|
char* name,
|
||||||
|
clock_t start,
|
||||||
|
clock_t* endTimes) {
|
||||||
|
double timesInMs[NUM_REPETITIONS];
|
||||||
|
double mean = 0;
|
||||||
|
clock_t lastEnd = start;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
||||||
|
lastEnd = endTimes[i];
|
||||||
|
mean += timesInMs[i];
|
||||||
|
}
|
||||||
|
mean /= NUM_REPETITIONS;
|
||||||
|
|
||||||
|
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
||||||
|
double median = timesInMs[NUM_REPETITIONS / 2];
|
||||||
|
|
||||||
|
double variance = 0;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
variance += pow(timesInMs[i] - mean, 2);
|
||||||
|
}
|
||||||
|
variance /= NUM_REPETITIONS;
|
||||||
|
double stddev = sqrt(variance);
|
||||||
|
|
||||||
|
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static YGSize _measure(
|
||||||
|
YGNodeRef node,
|
||||||
|
float width,
|
||||||
|
YGMeasureMode widthMode,
|
||||||
|
float height,
|
||||||
|
YGMeasureMode heightMode) {
|
||||||
return (YGSize){
|
return (YGSize){
|
||||||
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
|
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
|
||||||
.height = heightMode == YGMeasureModeUndefined ? 10 : width,
|
.height = heightMode == YGMeasureModeUndefined ? 10 : width,
|
||||||
@@ -23,7 +85,6 @@ static YGSize _measure(YGNodeRef node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
YGBENCHMARKS({
|
YGBENCHMARKS({
|
||||||
|
|
||||||
YGBENCHMARK("Stack with flex", {
|
YGBENCHMARK("Stack with flex", {
|
||||||
const YGNodeRef root = YGNodeNew();
|
const YGNodeRef root = YGNodeNew();
|
||||||
YGNodeStyleSetWidth(root, 100);
|
YGNodeStyleSetWidth(root, 100);
|
||||||
@@ -99,9 +160,10 @@ YGBENCHMARKS({
|
|||||||
YGNodeStyleSetHeight(grandGrandChild, 10);
|
YGNodeStyleSetHeight(grandGrandChild, 10);
|
||||||
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
||||||
|
|
||||||
for (uint32_t iii = 0; iii < 10; iii++) {
|
for (uint32_t iiii = 0; iiii < 10; iiii++) {
|
||||||
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
||||||
YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow);
|
YGNodeStyleSetFlexDirection(
|
||||||
|
grandGrandGrandChild, YGFlexDirectionRow);
|
||||||
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
||||||
YGNodeStyleSetWidth(grandGrandGrandChild, 10);
|
YGNodeStyleSetWidth(grandGrandGrandChild, 10);
|
||||||
YGNodeStyleSetHeight(grandGrandGrandChild, 10);
|
YGNodeStyleSetHeight(grandGrandGrandChild, 10);
|
||||||
@@ -114,5 +176,4 @@ YGBENCHMARKS({
|
|||||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||||
YGNodeFreeRecursive(root);
|
YGNodeFreeRecursive(root);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#define NUM_REPETITIONS 1000
|
|
||||||
|
|
||||||
#define YGBENCHMARKS(BLOCK) \
|
|
||||||
int main(int argc, char const *argv[]) { \
|
|
||||||
clock_t __start; \
|
|
||||||
clock_t __endTimes[NUM_REPETITIONS]; \
|
|
||||||
{ BLOCK } \
|
|
||||||
return 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YGBENCHMARK(NAME, BLOCK) \
|
|
||||||
__start = clock(); \
|
|
||||||
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
|
||||||
{ BLOCK } \
|
|
||||||
__endTimes[__i] = clock(); \
|
|
||||||
} \
|
|
||||||
__printBenchmarkResult(NAME, __start, __endTimes);
|
|
||||||
|
|
||||||
int __compareDoubles(const void *a, const void *b) {
|
|
||||||
double arg1 = *(const double *) a;
|
|
||||||
double arg2 = *(const double *) b;
|
|
||||||
|
|
||||||
if (arg1 < arg2) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg1 > arg2) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __printBenchmarkResult(char *name, clock_t start, clock_t *endTimes) {
|
|
||||||
double timesInMs[NUM_REPETITIONS];
|
|
||||||
double mean = 0;
|
|
||||||
clock_t lastEnd = start;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
|
||||||
lastEnd = endTimes[i];
|
|
||||||
mean += timesInMs[i];
|
|
||||||
}
|
|
||||||
mean /= NUM_REPETITIONS;
|
|
||||||
|
|
||||||
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
|
||||||
double median = timesInMs[NUM_REPETITIONS / 2];
|
|
||||||
|
|
||||||
double variance = 0;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
variance += pow(timesInMs[i] - mean, 2);
|
|
||||||
}
|
|
||||||
variance /= NUM_REPETITIONS;
|
|
||||||
double stddev = sqrt(variance);
|
|
||||||
|
|
||||||
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
|
||||||
}
|
|
57
build.gradle
57
build.gradle
@@ -1,14 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com/' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.2.2'
|
classpath 'com.android.tools.build:gradle:3.1.0'
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
|
||||||
classpath 'com.nabilhachicha:android-native-dependencies:0.1'
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
@@ -17,16 +25,47 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
flatDir {
|
|
||||||
dirs "${rootDir}/lib/jsr-305"
|
|
||||||
dirs "${rootDir}/lib/soloader"
|
|
||||||
dirs "${rootDir}/lib/appcompat"
|
|
||||||
dirs "${rootDir}/lib/android-support"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
minSdkVersion = 14
|
||||||
|
targetSdkVersion = 25
|
||||||
|
compileSdkVersion = 26
|
||||||
|
buildToolsVersion = '28.0.3'
|
||||||
|
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
|
||||||
|
targetCompatibilityVersion = JavaVersion.VERSION_1_7
|
||||||
|
}
|
||||||
|
|
||||||
|
// If you have an idea on how to avoid this, please get in touch or
|
||||||
|
// answer https://stackoverflow.com/questions/43867014/how-to-use-the-gradle-ndk-build-to-compile-for-the-host-machine.
|
||||||
|
task copyNativeLibs(type: Copy, dependsOn: ':buckBuildNative') {
|
||||||
|
from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/"
|
||||||
|
include '*.so'
|
||||||
|
include '*.dylib'
|
||||||
|
into "$buildDir/jniLibs"
|
||||||
|
}
|
||||||
|
|
||||||
|
task buckBuildNative(type: Exec) {
|
||||||
|
workingDir rootDir
|
||||||
|
environment BUCKVERSION: 'last'
|
||||||
|
commandLine 'buck', 'build', '//java/...'
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
afterEvaluate {
|
||||||
|
tasks.withType(Test) {
|
||||||
|
dependsOn copyNativeLibs
|
||||||
|
def libDir = "${rootDir}/build/jniLibs"
|
||||||
|
systemProperty 'java.library.path', libDir
|
||||||
|
environment 'LD_LIBRARY_PATH', libDir
|
||||||
|
environment 'DYLD_LIBRARY_PATH', libDir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
|
3
csharp/.gitignore
vendored
3
csharp/.gitignore
vendored
@@ -267,3 +267,6 @@ paket-files/
|
|||||||
# Python Tools for Visual Studio (PTVS)
|
# Python Tools for Visual Studio (PTVS)
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
|
# local buck build
|
||||||
|
lib/
|
||||||
|
@@ -267,3 +267,6 @@ paket-files/
|
|||||||
# Python Tools for Visual Studio (PTVS)
|
# Python Tools for Visual Studio (PTVS)
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
|
# local buck build
|
||||||
|
lib/
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@@ -4,17 +4,17 @@
|
|||||||
<BuildDependsOn>NativeLibraryARMV7;NativeLibraryX86;$(BuildDependsOn)</BuildDependsOn>
|
<BuildDependsOn>NativeLibraryARMV7;NativeLibraryX86;$(BuildDependsOn)</BuildDependsOn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="NativeLibraryARMV7" Outputs="$(ProjectDir)/lib/armeabi-v7a/libyoga.so">
|
<Target Name="NativeLibraryARMV7" Outputs="$(ProjectDir)/lib/armeabi-v7a/libyoga.so">
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-armv7,shared" />
|
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-armv7,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/armeabi-v7a/libyoga.so" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-armv7,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/armeabi-v7a/libyoga.so" SkipUnchangedFiles="true" />
|
||||||
</Target>
|
</Target>
|
||||||
<!--
|
<!--
|
||||||
<Target Name="NativeLibraryARM64" Outputs="$(ProjectDir)/lib/arm64-v8a/libyoga.so">
|
<Target Name="NativeLibraryARM64" Outputs="$(ProjectDir)/lib/arm64-v8a/libyoga.so">
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-arm64,shared" />
|
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-arm64,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/arm64-v8/libyoga.so" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-arm64,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/arm64-v8/libyoga.so" SkipUnchangedFiles="true" />
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
<Target Name="NativeLibraryX86" Outputs="$(ProjectDir)/lib/x86/libyoga.so">
|
<Target Name="NativeLibraryX86" Outputs="$(ProjectDir)/lib/x86/libyoga.so">
|
||||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-x86,shared" />
|
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../build-native.sh" />
|
||||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-x86,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/x86/libyoga.so" SkipUnchangedFiles="true" />
|
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-x86,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/x86/libyoga.so" SkipUnchangedFiles="true" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
64
csharp/BUCK
64
csharp/BUCK
@@ -1,31 +1,36 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||||
|
load(
|
||||||
|
"//tools/build_defs/oss:yoga_defs.bzl",
|
||||||
|
"BASE_COMPILER_FLAGS",
|
||||||
|
"yoga_apple_binary",
|
||||||
|
"yoga_cxx_library",
|
||||||
|
"yoga_dep",
|
||||||
|
)
|
||||||
|
|
||||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
||||||
|
|
||||||
csharp_library(
|
fb_native.csharp_library(
|
||||||
name = "yogalibnet46",
|
name = "yogalibnet46",
|
||||||
srcs = glob(["**/*.cs"]),
|
srcs = glob(["**/*.cs"]),
|
||||||
dll_name = "Facebook.Yoga.dll",
|
dll_name = "Facebook.Yoga.dll",
|
||||||
framework_ver = "net46",
|
framework_ver = "net46",
|
||||||
)
|
)
|
||||||
|
|
||||||
csharp_library(
|
fb_native.csharp_library(
|
||||||
name = "yogalibnet45",
|
name = "yogalibnet45",
|
||||||
srcs = glob(["**/*.cs"]),
|
srcs = glob(["**/*.cs"]),
|
||||||
dll_name = "Facebook.Yoga.dll",
|
dll_name = "Facebook.Yoga.dll",
|
||||||
framework_ver = "net45",
|
framework_ver = "net45",
|
||||||
)
|
)
|
||||||
|
|
||||||
cxx_library(
|
yoga_cxx_library(
|
||||||
name = "yoganet",
|
name = "yoganet",
|
||||||
srcs = glob(["Yoga/YGInterop.cpp"]),
|
srcs = ["Yoga/YGInterop.cpp"],
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
link_style = "static",
|
link_style = "static",
|
||||||
link_whole = True,
|
link_whole = True,
|
||||||
@@ -34,41 +39,4 @@ cxx_library(
|
|||||||
deps = [yoga_dep(":yoga")],
|
deps = [yoga_dep(":yoga")],
|
||||||
)
|
)
|
||||||
|
|
||||||
if isdir('/Applications/Xcode.app'):
|
yoga_apple_binary()
|
||||||
yoganet_ios_srcs = []
|
|
||||||
for arch in [
|
|
||||||
'iphonesimulator-x86_64', 'iphonesimulator-i386', 'iphoneos-arm64', 'iphoneos-armv7'
|
|
||||||
]:
|
|
||||||
name = 'yoganet-' + arch
|
|
||||||
yoganet_ios_srcs.append(':' + name)
|
|
||||||
genrule(
|
|
||||||
name = name,
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(':yoga#%s,static' % arch),
|
|
||||||
yoga_dep('YogaKit:YogaKit#%s,static' % arch),
|
|
||||||
yoga_dep('csharp:yoganet#%s,static' % arch),
|
|
||||||
],
|
|
||||||
out = 'libyoga-%s.a' % arch,
|
|
||||||
cmd = 'libtool -static -o $OUT $SRCS',
|
|
||||||
visibility = [yoga_dep('csharp:yoganet-ios')],
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = 'yoganet-ios',
|
|
||||||
srcs = yoganet_ios_srcs,
|
|
||||||
out = 'libyoga.a',
|
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
|
||||||
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
|
|
||||||
genrule(
|
|
||||||
name = 'yoganet-macosx',
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(yoganet_macosx_target % 'x86_64'),
|
|
||||||
yoga_dep(yoganet_macosx_target % 'i386'),
|
|
||||||
],
|
|
||||||
out = 'libyoga.dylib',
|
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -10,11 +10,15 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)BaselineFunction.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)BaselineFunction.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Logger.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)MeasureFunction.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)MeasureFunction.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)MeasureOutput.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)MeasureOutput.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Native.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Native.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGConfigHandle.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGNodeHandle.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)YogaAlign.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)YogaAlign.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)YogaBaselineFunc.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)YogaBaselineFunc.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaConfig.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)YogaConstants.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)YogaConstants.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)YogaDimension.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)YogaDimension.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)YogaDirection.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)YogaDirection.cs" />
|
||||||
|
15
csharp/Facebook.Yoga/Logger.cs
Normal file
15
csharp/Facebook.Yoga/Logger.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
public delegate void Logger(
|
||||||
|
YogaConfig config,
|
||||||
|
YogaNode node,
|
||||||
|
YogaLogLevel level,
|
||||||
|
string message);
|
||||||
|
}
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -12,12 +10,6 @@ using System.Runtime.InteropServices;
|
|||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
{
|
{
|
||||||
#if WINDOWS_UWP_ARM
|
|
||||||
using YogaValueType = IntPtr;
|
|
||||||
#else
|
|
||||||
using YogaValueType = YogaValue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
internal static class Native
|
internal static class Native
|
||||||
{
|
{
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
||||||
@@ -26,96 +18,9 @@ namespace Facebook.Yoga
|
|||||||
private const string DllName = "yoga";
|
private const string DllName = "yoga";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
internal class YGNodeHandle : SafeHandle
|
|
||||||
{
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
private GCHandle _managed;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private YGNodeHandle() : base(IntPtr.Zero, true)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool IsInvalid
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.handle == IntPtr.Zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool ReleaseHandle()
|
|
||||||
{
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
if (_managed.IsAllocated)
|
|
||||||
{
|
|
||||||
_managed.Free();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
Native.YGNodeFree(this.handle);
|
|
||||||
GC.KeepAlive(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
public void SetContext(YogaNode node)
|
|
||||||
{
|
|
||||||
if (!_managed.IsAllocated)
|
|
||||||
{
|
|
||||||
_managed = GCHandle.Alloc(node, GCHandleType.Weak);
|
|
||||||
Native.YGNodeSetContext(this.handle, GCHandle.ToIntPtr(_managed));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YogaNode GetManaged(IntPtr ygNodePtr)
|
|
||||||
{
|
|
||||||
var node =
|
|
||||||
GCHandle.FromIntPtr(Native.YGNodeGetContext(ygNodePtr)).Target as YogaNode;
|
|
||||||
if (node == null)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException("YogaNode is already deallocated");
|
|
||||||
}
|
|
||||||
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class YGConfigHandle : SafeHandle
|
|
||||||
{
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
private GCHandle _managed;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private YGConfigHandle() : base(IntPtr.Zero, true)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool IsInvalid
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.handle == IntPtr.Zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool ReleaseHandle()
|
|
||||||
{
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
if (_managed.IsAllocated)
|
|
||||||
{
|
|
||||||
_managed.Free();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
Native.YGConfigFree(this.handle);
|
|
||||||
GC.KeepAlive(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGInteropSetLogger(
|
public static extern void YGInteropSetLogger(
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger.Func func);
|
[MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger logger);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YGNodeHandle YGNodeNew();
|
public static extern YGNodeHandle YGNodeNew();
|
||||||
@@ -129,6 +34,9 @@ namespace Facebook.Yoga
|
|||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeReset(YGNodeHandle node);
|
public static extern void YGNodeReset(YGNodeHandle node);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern YGConfigHandle YGConfigGetDefault();
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YGConfigHandle YGConfigNew();
|
public static extern YGConfigHandle YGConfigNew();
|
||||||
|
|
||||||
@@ -136,7 +44,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGConfigFree(IntPtr node);
|
public static extern void YGConfigFree(IntPtr node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int YGNodeGetInstanceCount();
|
public static extern int YGConfigGetInstanceCount();
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGConfigSetExperimentalFeatureEnabled(
|
public static extern void YGConfigSetExperimentalFeatureEnabled(
|
||||||
@@ -149,6 +57,27 @@ namespace Facebook.Yoga
|
|||||||
YGConfigHandle config,
|
YGConfigHandle config,
|
||||||
YogaExperimentalFeature feature);
|
YogaExperimentalFeature feature);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGConfigSetUseWebDefaults(
|
||||||
|
YGConfigHandle config,
|
||||||
|
bool useWebDefaults);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern bool YGConfigGetUseWebDefaults(YGConfigHandle config);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGConfigSetUseLegacyStretchBehaviour(
|
||||||
|
YGConfigHandle config,
|
||||||
|
bool useLegacyStretchBehavior);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGConfigSetPointScaleFactor(
|
||||||
|
YGConfigHandle config,
|
||||||
|
float pixelsInPoint);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeInsertChild(
|
public static extern void YGNodeInsertChild(
|
||||||
YGNodeHandle node,
|
YGNodeHandle node,
|
||||||
@@ -158,6 +87,14 @@ namespace Facebook.Yoga
|
|||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeRemoveChild(YGNodeHandle node, YGNodeHandle child);
|
public static extern void YGNodeRemoveChild(YGNodeHandle node, YGNodeHandle child);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeSetIsReferenceBaseline(
|
||||||
|
YGNodeHandle node,
|
||||||
|
bool isReferenceBaseline);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern bool YGNodeIsReferenceBaseline(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeCalculateLayout(
|
public static extern void YGNodeCalculateLayout(
|
||||||
YGNodeHandle node,
|
YGNodeHandle node,
|
||||||
@@ -288,7 +225,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetFlexBasisAuto(YGNodeHandle node);
|
public static extern void YGNodeStyleSetFlexBasisAuto(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetFlexBasis(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetFlexBasis(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetWidth(YGNodeHandle node, float width);
|
public static extern void YGNodeStyleSetWidth(YGNodeHandle node, float width);
|
||||||
@@ -300,7 +237,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetWidthAuto(YGNodeHandle node);
|
public static extern void YGNodeStyleSetWidthAuto(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetWidth(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetHeight(YGNodeHandle node, float height);
|
public static extern void YGNodeStyleSetHeight(YGNodeHandle node, float height);
|
||||||
@@ -312,7 +249,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetHeightAuto(YGNodeHandle node);
|
public static extern void YGNodeStyleSetHeightAuto(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetHeight(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMinWidth(YGNodeHandle node, float minWidth);
|
public static extern void YGNodeStyleSetMinWidth(YGNodeHandle node, float minWidth);
|
||||||
@@ -321,7 +258,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetMinWidthPercent(YGNodeHandle node, float minWidth);
|
public static extern void YGNodeStyleSetMinWidthPercent(YGNodeHandle node, float minWidth);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetMinWidth(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetMinWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMinHeight(YGNodeHandle node, float minHeight);
|
public static extern void YGNodeStyleSetMinHeight(YGNodeHandle node, float minHeight);
|
||||||
@@ -330,7 +267,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetMinHeightPercent(YGNodeHandle node, float minHeight);
|
public static extern void YGNodeStyleSetMinHeightPercent(YGNodeHandle node, float minHeight);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetMinHeight(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetMinHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMaxWidth(YGNodeHandle node, float maxWidth);
|
public static extern void YGNodeStyleSetMaxWidth(YGNodeHandle node, float maxWidth);
|
||||||
@@ -339,7 +276,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetMaxWidthPercent(YGNodeHandle node, float maxWidth);
|
public static extern void YGNodeStyleSetMaxWidthPercent(YGNodeHandle node, float maxWidth);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetMaxWidth(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetMaxWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMaxHeight(YGNodeHandle node, float maxHeight);
|
public static extern void YGNodeStyleSetMaxHeight(YGNodeHandle node, float maxHeight);
|
||||||
@@ -348,7 +285,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetMaxHeightPercent(YGNodeHandle node, float maxHeight);
|
public static extern void YGNodeStyleSetMaxHeightPercent(YGNodeHandle node, float maxHeight);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetMaxHeight(YGNodeHandle node);
|
public static extern YogaValue YGNodeStyleGetMaxHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetAspectRatio(YGNodeHandle node, float aspectRatio);
|
public static extern void YGNodeStyleSetAspectRatio(YGNodeHandle node, float aspectRatio);
|
||||||
@@ -367,7 +304,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetPositionPercent(YGNodeHandle node, YogaEdge edge, float position);
|
public static extern void YGNodeStyleSetPositionPercent(YGNodeHandle node, YogaEdge edge, float position);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge);
|
public static extern YogaValue YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMargin(YGNodeHandle node, YogaEdge edge, float margin);
|
public static extern void YGNodeStyleSetMargin(YGNodeHandle node, YogaEdge edge, float margin);
|
||||||
@@ -379,7 +316,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetMarginAuto(YGNodeHandle node, YogaEdge edge);
|
public static extern void YGNodeStyleSetMarginAuto(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);
|
public static extern YogaValue YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetPadding(YGNodeHandle node, YogaEdge edge, float padding);
|
public static extern void YGNodeStyleSetPadding(YGNodeHandle node, YogaEdge edge, float padding);
|
||||||
@@ -388,7 +325,7 @@ namespace Facebook.Yoga
|
|||||||
public static extern void YGNodeStyleSetPaddingPercent(YGNodeHandle node, YogaEdge edge, float padding);
|
public static extern void YGNodeStyleSetPaddingPercent(YGNodeHandle node, YogaEdge edge, float padding);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaValueType YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge);
|
public static extern YogaValue YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetBorder(YGNodeHandle node, YogaEdge edge, float border);
|
public static extern void YGNodeStyleSetBorder(YGNodeHandle node, YogaEdge edge, float border);
|
||||||
@@ -429,15 +366,19 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IOS
|
#region Context
|
||||||
|
|
||||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr YGNodeGetContext(IntPtr node);
|
public static extern IntPtr YGNodeGetContext(IntPtr node);
|
||||||
|
|
||||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeSetContext(IntPtr node, IntPtr managed);
|
public static extern void YGNodeSetContext(IntPtr node, IntPtr managed);
|
||||||
#endif
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern IntPtr YGConfigGetContext(IntPtr config);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGConfigSetContext(IntPtr config, IntPtr managed);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
82
csharp/Facebook.Yoga/YGConfigHandle.cs
Normal file
82
csharp/Facebook.Yoga/YGConfigHandle.cs
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
internal class YGConfigHandle : SafeHandle
|
||||||
|
{
|
||||||
|
internal static readonly YGConfigHandle Default = Native.YGConfigGetDefault();
|
||||||
|
private GCHandle _managedConfigHandle;
|
||||||
|
|
||||||
|
private YGConfigHandle() : base(IntPtr.Zero, true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsInvalid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.handle == IntPtr.Zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool ReleaseHandle()
|
||||||
|
{
|
||||||
|
if (this.handle != Default.handle)
|
||||||
|
{
|
||||||
|
ReleaseManaged();
|
||||||
|
if (!IsInvalid)
|
||||||
|
{
|
||||||
|
Native.YGConfigFree(this.handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GC.KeepAlive(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetContext(YogaConfig config)
|
||||||
|
{
|
||||||
|
if (!_managedConfigHandle.IsAllocated)
|
||||||
|
{
|
||||||
|
#if UNITY_5_4_OR_NEWER
|
||||||
|
// Weak causes 'GCHandle value belongs to a different domain' error
|
||||||
|
_managedConfigHandle = GCHandle.Alloc(config);
|
||||||
|
#else
|
||||||
|
_managedConfigHandle = GCHandle.Alloc(config, GCHandleType.Weak);
|
||||||
|
#endif
|
||||||
|
var managedConfigPtr = GCHandle.ToIntPtr(_managedConfigHandle);
|
||||||
|
Native.YGConfigSetContext(this.handle, managedConfigPtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReleaseManaged()
|
||||||
|
{
|
||||||
|
if (_managedConfigHandle.IsAllocated)
|
||||||
|
{
|
||||||
|
_managedConfigHandle.Free();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaConfig GetManaged(IntPtr unmanagedConfigPtr)
|
||||||
|
{
|
||||||
|
if (unmanagedConfigPtr != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
var managedConfigPtr = Native.YGConfigGetContext(unmanagedConfigPtr);
|
||||||
|
var config = GCHandle.FromIntPtr(managedConfigPtr).Target as YogaConfig;
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("YogaConfig is already deallocated");
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
78
csharp/Facebook.Yoga/YGNodeHandle.cs
Normal file
78
csharp/Facebook.Yoga/YGNodeHandle.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
internal class YGNodeHandle : SafeHandle
|
||||||
|
{
|
||||||
|
private GCHandle _managedNodeHandle;
|
||||||
|
|
||||||
|
private YGNodeHandle() : base(IntPtr.Zero, true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsInvalid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.handle == IntPtr.Zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool ReleaseHandle()
|
||||||
|
{
|
||||||
|
ReleaseManaged();
|
||||||
|
if (!IsInvalid)
|
||||||
|
{
|
||||||
|
Native.YGNodeFree(this.handle);
|
||||||
|
GC.KeepAlive(this);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetContext(YogaNode node)
|
||||||
|
{
|
||||||
|
if (!_managedNodeHandle.IsAllocated)
|
||||||
|
{
|
||||||
|
#if UNITY_5_4_OR_NEWER
|
||||||
|
// Weak causes 'GCHandle value belongs to a different domain' error
|
||||||
|
_managedNodeHandle = GCHandle.Alloc(node);
|
||||||
|
#else
|
||||||
|
_managedNodeHandle = GCHandle.Alloc(node, GCHandleType.Weak);
|
||||||
|
#endif
|
||||||
|
var managedNodePtr = GCHandle.ToIntPtr(_managedNodeHandle);
|
||||||
|
Native.YGNodeSetContext(this.handle, managedNodePtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReleaseManaged()
|
||||||
|
{
|
||||||
|
if (_managedNodeHandle.IsAllocated)
|
||||||
|
{
|
||||||
|
_managedNodeHandle.Free();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaNode GetManaged(IntPtr unmanagedNodePtr)
|
||||||
|
{
|
||||||
|
if (unmanagedNodePtr != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
var managedNodePtr = Native.YGNodeGetContext(unmanagedNodePtr);
|
||||||
|
var node = GCHandle.FromIntPtr(managedNodePtr).Target as YogaNode;
|
||||||
|
if (node == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("YogaNode is already deallocated");
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -13,5 +11,5 @@ using System.Runtime.InteropServices;
|
|||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
{
|
{
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate float YogaBaselineFunc(IntPtr node, float width, float height);
|
public delegate float YogaBaselineFunc(IntPtr unmanagedNodePtr, float width, float height);
|
||||||
}
|
}
|
||||||
|
151
csharp/Facebook.Yoga/YogaConfig.cs
Normal file
151
csharp/Facebook.Yoga/YogaConfig.cs
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
#if __IOS__
|
||||||
|
using ObjCRuntime;
|
||||||
|
#endif
|
||||||
|
#if ENABLE_IL2CPP
|
||||||
|
using AOT;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
public class YogaConfig
|
||||||
|
{
|
||||||
|
internal static readonly YogaConfig Default = new YogaConfig(YGConfigHandle.Default);
|
||||||
|
private static YogaLogger _managedLogger;
|
||||||
|
|
||||||
|
private YGConfigHandle _ygConfig;
|
||||||
|
private Logger _logger;
|
||||||
|
|
||||||
|
private YogaConfig(YGConfigHandle ygConfig)
|
||||||
|
{
|
||||||
|
_ygConfig = ygConfig;
|
||||||
|
if (_ygConfig.IsInvalid)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Failed to allocate native memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
_ygConfig.SetContext(this);
|
||||||
|
|
||||||
|
if (_ygConfig == YGConfigHandle.Default)
|
||||||
|
{
|
||||||
|
_managedLogger = LoggerInternal;
|
||||||
|
Native.YGInteropSetLogger(_managedLogger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public YogaConfig()
|
||||||
|
: this(Native.YGConfigNew())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal YGConfigHandle Handle
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
return _ygConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (UNITY_IOS && !UNITY_EDITOR) || ENABLE_IL2CPP || __IOS__
|
||||||
|
[MonoPInvokeCallback(typeof(YogaLogger))]
|
||||||
|
#endif
|
||||||
|
private static void LoggerInternal(
|
||||||
|
IntPtr unmanagedConfigPtr,
|
||||||
|
IntPtr unmanagedNodePtr,
|
||||||
|
YogaLogLevel level,
|
||||||
|
string message)
|
||||||
|
{
|
||||||
|
var config = YGConfigHandle.GetManaged(unmanagedConfigPtr);
|
||||||
|
if (config == null || config._logger == null)
|
||||||
|
{
|
||||||
|
// Default logger
|
||||||
|
System.Diagnostics.Debug.WriteLine(message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var node = YGNodeHandle.GetManaged(unmanagedNodePtr);
|
||||||
|
config._logger(config, node, level, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (level == YogaLogLevel.Error || level == YogaLogLevel.Fatal)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Logger Logger
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
return _logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
_logger = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetExperimentalFeatureEnabled(
|
||||||
|
YogaExperimentalFeature feature,
|
||||||
|
bool enabled)
|
||||||
|
{
|
||||||
|
Native.YGConfigSetExperimentalFeatureEnabled(_ygConfig, feature, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsExperimentalFeatureEnabled(YogaExperimentalFeature feature)
|
||||||
|
{
|
||||||
|
return Native.YGConfigIsExperimentalFeatureEnabled(_ygConfig, feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseWebDefaults
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Native.YGConfigGetUseWebDefaults(_ygConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Native.YGConfigSetUseWebDefaults(_ygConfig, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseLegacyStretchBehaviour
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Native.YGConfigGetUseLegacyStretchBehaviour(_ygConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Native.YGConfigSetUseLegacyStretchBehaviour(_ygConfig, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float PointScaleFactor
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Native.YGConfigSetPointScaleFactor(_ygConfig, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetInstanceCount()
|
||||||
|
{
|
||||||
|
return Native.YGConfigGetInstanceCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetDefaultLogger(Logger logger)
|
||||||
|
{
|
||||||
|
Default.Logger = logger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,18 +1,14 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
{
|
{
|
||||||
public enum YogaExperimentalFeature
|
public enum YogaExperimentalFeature
|
||||||
{
|
{
|
||||||
Rounding,
|
|
||||||
WebFlexBasis,
|
WebFlexBasis,
|
||||||
MinFlexFix,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
@@ -16,5 +14,6 @@ namespace Facebook.Yoga
|
|||||||
FlexEnd,
|
FlexEnd,
|
||||||
SpaceBetween,
|
SpaceBetween,
|
||||||
SpaceAround,
|
SpaceAround,
|
||||||
|
SpaceEvenly,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user