Summary:
With the current setup, the final aar contains `com.facebook.proguard.annotation.DoNotStrip`. This is not needed (it is only used for proguard), and thus should not get published.
We move proguard annotations into its own project for this, and place it into `java/proguard-annotations`. Here we adopt the gradle convention of `src/main` to make for a nice, clean (one line!) gradle script. As a different subproject, we can include this to `:yoga` as a `provided` dependency now, which doesn't include it in the output artifact.
Reviewed By: emilsjolander
Differential Revision: D4666572
fbshipit-source-id: a0cb26cb6c264065a0bd355b7d72ba02e3759560
Summary: I accidentally used pngs for the bintray badges. This renders ugly sometimes. This corrects that.
Reviewed By: emilsjolander
Differential Revision: D4666641
fbshipit-source-id: df53f08a77be3067804d7671d673146f208a24fd
Summary: This adds bintray badges to the readme, and creates a readme for the android code.
Reviewed By: emilsjolander
Differential Revision: D4666314
fbshipit-source-id: a2549374f3e9c39c260160d1e32fb37801ff4208
Summary: The gists in the docs have large margins to fit with the front page. This diff specialises that margin setting and sets it to something smaller for other gists.
Reviewed By: emilsjolander
Differential Revision: D4666016
fbshipit-source-id: 5121849a153e78d523b33e10b96641426e794f8d
Summary: This improves the quality of the published POM files, adding dependencies and marking the object as an 'aar'. It also bumps the version to 1.2.0 for JCenter.
Reviewed By: emilsjolander
Differential Revision: D4620150
fbshipit-source-id: 968f1cea21af4b2f19aeff3f32ad575b185fa1bb
Summary:
The issue is on ARM builds for Windows UWP. For the C# P/Invoke API wrapper, any native method that returns the YogaValue struct throws the AccessViolationException. The issue is not with structs in general, as returning the YogaSize / YGSize struct works fine. The issue seems to be limited to structs that have an enum member.
I tried a number of things to resolve the issue without changing the underlying native API for Windows. I read the ARM documentation and saw reference to variable enum sizes based on the number of enum members, so I tried to use a number of different UnmanagedType values in a [MarsalAs()] attribute on the enum member of the C# struct declaration.
What ultimately worked was to return a pointer to the location of the struct, and use the System.Runtime.InteropServices.PtrToStructure API to read the struct data from that pointer. I added a few new macros that will return the struct address on Windows only, other builds are not affected.
Note, I have not tested the impact of this ch
Closes https://github.com/facebook/yoga/pull/459
Reviewed By: emilsjolander
Differential Revision: D4652278
Pulled By: splhack
fbshipit-source-id: bf7ada4da1781e3f813b3ba331974b7bded476d9
Summary:
If we set ```display:none``` all children are set with layout sizes/values of 0. We need do mark all those children as dirty to force a relayout if we toggle the display on a higher parent node. This fixes#443
Closes https://github.com/facebook/yoga/pull/448
Reviewed By: astreet
Differential Revision: D4642273
Pulled By: emilsjolander
fbshipit-source-id: dfdb920e2049952bd6c7f48cfa53b1448e1f3e8f
Summary:
This sets the new ```YGExperimentalFeatureMinFlexFix``` explicitly to false in the config.
It also a changes a stretch reason to reflect that it is the strech in a multiline.
Closes https://github.com/facebook/yoga/pull/447
Reviewed By: astreet
Differential Revision: D4642275
Pulled By: emilsjolander
fbshipit-source-id: 26777db7008ff6ee86da72ca9ea19e979b916cc9
Summary:
Use ```float``` for calculation, as we would calculate with ```double``` and cast to float afterwards otherwise. So this removes the warning.
Closes https://github.com/facebook/yoga/pull/450
Reviewed By: astreet
Differential Revision: D4642267
Pulled By: emilsjolander
fbshipit-source-id: 184ef24474f2b8a42654a71a8e98839296648b2b
Summary: Add test covering a nested percentage container inside of a unconstraint container. This is something we ran into recently and want to make sure to cover in tests.
Reviewed By: astreet
Differential Revision: D4637519
fbshipit-source-id: a8fe3c7702c2ea0ad954cce80fbdf953bb23c997
Summary: Some of the tests were not generated correctly. most likely due to a rebase.
Reviewed By: astreet
Differential Revision: D4637539
fbshipit-source-id: 196478d7e5197519af9ab05e5134e6fb7d22b992
Summary: To avoid clashes in the `app:` namespace, we prefix all yoga attributes with `yg_`.
Reviewed By: emilsjolander
Differential Revision: D4643080
fbshipit-source-id: 3e9265fd57e56a1df2f687a5d17c5bc66b8befa3
Summary: When some drawing attributes of a view changes how it measures, we need to be able to relayout it correctly. This adds method `invalidate(View)` to `YogaLayout` which will flag the corresponding node as dirty and requiring layout again.
Reviewed By: emilsjolander
Differential Revision: D4634563
fbshipit-source-id: af7f47dce00a31414d0987a58307c5d44c1bcf20
Summary:
Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 .
Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config.
New function for calculation is ```YGNodeCalculateLayoutWithConfig```.
Closes https://github.com/facebook/yoga/pull/432
Reviewed By: astreet
Differential Revision: D4611359
Pulled By: emilsjolander
fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
Summary: This is a follow up on a recent change which made the constraints passed into conculateLayout describe the parent constraints and not the root node constraints. This broke some assumptions and was not very inuitive if no size was set on the root. Therefor this diff ensure that if the root node does not have any size set then it will adopt the size of the parent constraints.
Reviewed By: dshahidehpour
Differential Revision: D4634616
fbshipit-source-id: 089eb4313c5bb810a6ff56f158cd19cec71808ec
Summary: This diff updates the NDK version from 10 to 12
Reviewed By: emilsjolander
Differential Revision: D4634938
fbshipit-source-id: 6a9cbc48dbcbda4674d6460120c7a0d8abd626ab
Summary: [This commit](1146013e9e) (or diff D4501142) adds an `auto` option for margins. This diff allows you to leverage that in android via attribute `yoga:margin_all="auto"` (and as expected for the other edges).
Reviewed By: emilsjolander
Differential Revision: D4634684
fbshipit-source-id: 158f70ec975b5bb3a666e590b76eb52daeb38f49
Summary: Test fails when we have flexible child and min/max layout dimension. Yoga should flex the child to minimal size, while in reality Yoga flexes it to maximal size
Reviewed By: emilsjolander
Differential Revision: D4558653
fbshipit-source-id: 06b38d7ed43aee063cc881f38b84558641f043f3
Summary:
Changed the flex getters to return the values they were actually set. See #421 .
Closes https://github.com/facebook/yoga/pull/431
Reviewed By: astreet
Differential Revision: D4604744
Pulled By: emilsjolander
fbshipit-source-id: 02d79100ef22be866db1c3bd9d53e4447186811f
Summary: The size of the node is already set on the node however there was no way to set the size of the parent to the root so that the root could use percentages. This change fixes this by making the width and height passed to calculate layout be the width and height of the hypothetical parent.
Reviewed By: astreet
Differential Revision: D4611417
fbshipit-source-id: 2fb0eedffa17f0ec89b601722a1717a72e216b9e
Summary: Diff D4501141 added display attributes for Yoga. This exposes them in the android library.
Reviewed By: emilsjolander
Differential Revision: D4605574
fbshipit-source-id: dbad3d6fe924682c6b81f65bbba9727085de2d81
Summary: The android sdk and api installation seems to be timing out on Travis. This should extend the 10 minute limit to 20 minutes. Hopefully this will be enough to download it all. If not, we must just extend the timeout.
Reviewed By: emilsjolander
Differential Revision: D4588245
fbshipit-source-id: fef25c54b081ba4d96d1e0435c6c1f643ff49b66
Summary: This diff adds rounding to the pixel grid feature to Yoga and appropriate property
Reviewed By: emilsjolander
Differential Revision: D4565980
fbshipit-source-id: 9700f6d6ed147f82b19f230fbff2e9ccbd625b25
Summary:
Fix for #413. This was a hangover from a previous attept to fix other align-content problems.
Closes https://github.com/facebook/yoga/pull/417
Reviewed By: astreet
Differential Revision: D4604727
Pulled By: emilsjolander
fbshipit-source-id: 92fd31a385d8182c6b201c891d5ae478372d525d
Summary: Adds a buildscript for gradle as well as bintray upload capabilities for the YogaLayout library
Reviewed By: emilsjolander
Differential Revision: D4604712
fbshipit-source-id: bacbcc20b7ed6ee8689130287a48bd5d3826298c
Summary: This builds the java bindings with gradle, and adds a script for Facebook employees to upload the generated artifacts to JCenter.
Reviewed By: emilsjolander
Differential Revision: D4597335
fbshipit-source-id: 4c01695a8638000a417bfb49deba4b9b9b4e114b
Summary:
Since my new main work maschine is a hdpi device, all the gentests with rounding are producing different outputs.
This PR force the scalefactor=1 for gentest to fix issues with generation on hdpi devices.
Closes https://github.com/facebook/yoga/pull/434
Differential Revision: D4604724
Pulled By: emilsjolander
fbshipit-source-id: ce4036ae71a45775280e0504f20c06a4622ccceb
Summary: The attribute for height was incorrectly assumed to be type `float` which led to it not being explicitly defined. It is actually a dimension.
Reviewed By: emilsjolander
Differential Revision: D4588629
fbshipit-source-id: 56c7e460d27528823944852d682e7f26bf908292
Summary: When a container's children wrap the container should match the parent size and not wrap to the new size of the children. This is confirmed behavior in chrome.
Reviewed By: astreet
Differential Revision: D4578614
fbshipit-source-id: 5d22a3a673735587384d775189158a87bb1d457d
Summary:
Travis android build is failing with
BUILD FAILED: Google APIs not found in /usr/local/opt/android-sdk/add-ons/addon-google_apis-google-19/libs.
Please run '/usr/local/opt/android-sdk/tools/android sdk' and select both 'SDK Platform' and 'Google APIs' under Android (API 19)
This should fix that error
Reviewed By: emilsjolander
Differential Revision: D4588053
fbshipit-source-id: e57d635141e8aede5803b919ee5a28a60c5e667c
Summary:
You must measure children before you lay them out, and YogaLayout didn't do this. This fixes that.
We also only recompute the yoga tree if the YogaLayout is laid out with a different size to what it's been measured as.
Reviewed By: emilsjolander
Differential Revision: D4572237
fbshipit-source-id: 6e86dbf939b06338c1dc2a37b7dafafd548dd390
Summary:
For now i setup the CI using VSTS (Visual Studio Team Services) , i m using my own account, but i want to move this to a Travis setup so it would be easy ported to Facebook own build system. We can also take a look on how buck can help with this.
Here's a overview of my dashboard for the build and release process on VSTS:
<img width="1084" alt="screen shot 2017-02-16 at 23 52 07" src="https://cloud.githubusercontent.com/assets/1235097/23046869/ff4dcada-f4a3-11e6-8d09-fb8974fb58d4.png">
The all process is pretty simple, there's a few tricks here and there, but the basic steps are:
<img width="1036" alt="builds" src="https://cloud.githubusercontent.com/assets/1235097/23046874/0cb95fc2-f4a4-11e6-8fd8-3048be7ffd9d.png">
These run for every commit and publish the artifacts, then the release lane takes that artifacts and builds a nuget, after that (and it's not implemented yet) we run UI Tests on devices Android , iOS for the nuget created and run tests on UWP and .net45 on both windows and OS X so
Closes https://github.com/facebook/yoga/pull/408
Reviewed By: emilsjolander
Differential Revision: D4576542
Pulled By: splhack
fbshipit-source-id: 66e0e4c1cb3721ed7aa7118e4e226b6ec575fea8
Summary:
The existing Yoga.vcxproj works great for Desktop apps, but breaks when you try to use the resulting DLL on mobile, Xbox, etc. This change compiles the DLL for the UWP and the Windows Store.
Closes https://github.com/facebook/yoga/pull/401
Reviewed By: emilsjolander
Differential Revision: D4561354
Pulled By: splhack
fbshipit-source-id: 643ad4ed1ffc73719d35974e2d357c37d5b1d1c4