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
Summary:
Based on the idea of #386 by rmarinho
Closes https://github.com/facebook/yoga/pull/388
Reviewed By: emilsjolander
Differential Revision: D4570778
Pulled By: splhack
fbshipit-source-id: 362983deaf6f040c42b3db8205b711e7e5e60eaf
Summary:
When using AOT mode on Mono one can't use instance methods for callbacks, the compiler needs the MonoPInvokeCallback attribute on a static method to know how to get back to the managed world.
This worked fine without the change in JIT mode.
I not sure if we should use a __MONO__ flag for this stuff as this could be needed for other usage that not only on iOS.
~~The adicional change is that one should as good practice call Dispose on the YogaNode when using callbacks to make sure we remove the handler from our dictionary, i was trying to write a test for this.. but i saw TestMeasureFuncWithDestructor was already there, but it doesn't seem correct to me, can you check splhack.~~
Closes https://github.com/facebook/yoga/pull/386
Reviewed By: emilsjolander
Differential Revision: D4546030
Pulled By: splhack
fbshipit-source-id: 121d44a2ecd14d754b9614493db6ac15fca02da2
Summary: Fix unit test for flexBasis
Reviewed By: emilsjolander
Differential Revision: D4572394
fbshipit-source-id: ce0b3cd28b5c8a9910106308c561c95d1b3866e9
Summary:
This PR removes some duplicate code by calculating with ```mainSize```/```crossSize``` and converting that to ```width``` or ```height``` at the end. See #395 .
Closes https://github.com/facebook/yoga/pull/396
Reviewed By: astreet
Differential Revision: D4564713
Pulled By: emilsjolander
fbshipit-source-id: 0b24e69cc9dc75cdf93deeb6c076dcacf134c6d8
Summary: There are still some pieces of RN which does not handle YGUnitAuto and makes use of either the value being nan or the unit being undefined. This diff makes this more robust to those kinds of situations.
Reviewed By: wwjholmes
Differential Revision: D4567045
fbshipit-source-id: ace5fd89bd534a6bb5ec7dba0c3afbf13d62d7c9
Summary: Travis builds are failing due to ANDROID_SDK not being set. So we set both it and ANDROID_HOME to where homebrew should have created a link to the installation.
Reviewed By: emilsjolander
Differential Revision: D4571703
fbshipit-source-id: a6dc4eb07006dc8baefb6ca938111ff256c6f018
Summary: Adds the Travis build badge for the android target to the README.md
Reviewed By: emilsjolander
Differential Revision: D4571693
fbshipit-source-id: a5110dac7d86989cc4a14b858c63d59332072869
Summary: The yoga splash screen that runs at the beginning of the app is unnecessary and can be removed for simplicty.
Reviewed By: emilsjolander
Differential Revision: D4571624
fbshipit-source-id: 3eb12f7c3447805f4546bd192df9670c5427572a
Summary:
I couldn't resist to do this 😄#394
This adds ```flex-wrap: wrap-reverse```
I think we hit a edge case here:
https://stackoverflow.com/questions/33891709/when-flexbox-items-wrap-in-column-mode-container-does-not-grow-its-width
as is differs here from chrome, but I think that yoga is here more correct.
So I haven't added this test yet as this would fail against chrome, as chrome outputs a width of 30 for root, whereas yoga gets a width of 60 here, which I think is correct. Strangely the output of ```flex-wrap:wrap``` is in jsfiddle also only with a (visual) width of 30 on chrome, while the tests gets generated with 60.
```html
<div id="wrap_reverse_column" style="height: 100px; flex-wrap: wrap-reverse">
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
</div>
```
Looking forward what you think here emilsjolander
Closes https://github.com/facebook/yoga/pull/398
Reviewed By: astreet
Differential Revision: D4564711
Pulled By: emilsjolander
fbshipit-source-id: 33dc055abd8444b2aa7796ef90bd7ec99e961bb8
Summary:
I don't even know how people have been running tests (unless they install BUCK). This creates a workspace to make it much easier to run tests.
Closes https://github.com/facebook/yoga/pull/400
Differential Revision: D4565290
Pulled By: dshahidehpour
fbshipit-source-id: 762168ced81e517126ac05c92bb27ccad0d9d305
Summary:
We still had the default one from the template.
Closes https://github.com/facebook/yoga/pull/403
Reviewed By: astreet
Differential Revision: D4564708
Pulled By: emilsjolander
fbshipit-source-id: ec76325e0dca34f89e5a920627ced7fa812827de
Summary:
...to reflect the modern world we live in with dynamic DPI platforms :)
Closes https://github.com/facebook/yoga/pull/375
Reviewed By: dshahidehpour
Differential Revision: D4528518
Pulled By: emilsjolander
fbshipit-source-id: e422bd4ae148e02c598a7b484a6adfa8c0e1e0c9
Summary:
Even so I know there are some opinions against ```margin: 0 auto``` it's still part of the spec: https://www.w3.org/TR/css-flexbox-1/#auto-margins and pretty usefull if you have to position via ```justify-content```.
This PR adds an implementation for that.
It adds an additonal ```YGUnitAuto``` and margins got ```YGNodeStyleSetMarginAuto``` functions as well.
Closes https://github.com/facebook/yoga/pull/357
Reviewed By: astreet
Differential Revision: D4501142
Pulled By: emilsjolander
fbshipit-source-id: 86519f8632496f46e78a7c9dbc5b21e212e3e0c7
Summary: This is an update of facebook/yoga#368 which was reverted. It fixes support for align-content: strech with multiple lines. The problem with the last attempt at solving this was that align-items:stretch was interfering. We handle this now by detecting when the flex basis of the children hints at them overflowing. This is not 100% correct as the size of the items could change when remeasuring but it will work in 99% of cases.
Reviewed By: astreet
Differential Revision: D4551234
fbshipit-source-id: 2964f19cf415991dc55dfa2caa4868cb00c56bd0
Summary: The sample app has library-like elements (i.e. the `YogaLayout` and associated files). This separates them out into a separate tree.
Reviewed By: emilsjolander
Differential Revision: D4558263
fbshipit-source-id: 33f8cec99661ef20e0e882663b554c12ae33c12f
Summary: Adds a simple "photo with poster and comment" layout to the landing page as an example for Android, along with the XML.
Reviewed By: emilsjolander
Differential Revision: D4558478
fbshipit-source-id: c7302321a67e99f5853358e711ff538d192f06e9
Summary: Resources don't usually live under the package name. We want to gradle build this soon, so making the directory structure as traditional as possible is best.
Reviewed By: emilsjolander
Differential Revision: D4557978
fbshipit-source-id: 7f80599201fe007a895e52bc5141425f9a83eb51
Summary: Adds docs for how to build the Android sample app and use the `YogaLayout`.
Reviewed By: emilsjolander
Differential Revision: D4557955
fbshipit-source-id: 49a3b8fde20de81a895244ffcecbd5bf392455b0
Summary: && instead of ; and only update xctools if needed
Reviewed By: passy
Differential Revision: D4558044
fbshipit-source-id: 90d55bf0147026e527b238365835d803a4bee7fb
Summary: The sample app is simply moved into the repo. A few libraries are included and the buck targets rearranged.
Reviewed By: emilsjolander
Differential Revision: D4528129
fbshipit-source-id: 3e9e779857cd9219711a939876c9275d75e09929
Summary:
I'm cleaning up these files in their own revision because I want to trigger
dirsync sandcastle separately from my other cleanup.
Reviewed By: mzlee
Differential Revision: D4549131
fbshipit-source-id: 1d45118256d8b517dea7a2b6c9e50bca1ccc1b0c
Summary: For some internal Instagram diffs, and some external ones (auto-detection of dirty nodes). We need to give the dirty properties a little love. This adds a getter to find out if your node is dirty, and makes sure that the leaf node is properly setup before it is marked dirty to prevent a crash.
Reviewed By: emilsjolander
Differential Revision: D4549241
fbshipit-source-id: 36eda6fdb4ea7f968d126aab6da67896f4a01d40
Summary:
Currently, our configuration of Views looks like this:
```objc
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
view.yoga.isEnabled = YES;
view.yoga.height = 50;
view.yoga.width = 50;
```
Every time that we access `view.yoga` we have to access the associated object on `UIView` to get the `YGLayout`. This adds an extra `objc_msgSend` which increases binary size, and is slight perf impact.
This diff creates a way to modify the `YGLayout` with only a single `objc_msgSend`. Here's the new syntax:
```objc
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
[view configureLayoutWithBlock:^void(YGLayout *layout){
layout.isEnabled = YES
layout.height = 50;
layout.width = 50;
}];
```
Here's the Swift version:
```swift
let view = UIView(frame: .zero)
view.configureLayout { (layout) in
layout.isEnabled = true
layout.height = 50
layout.width = 50
}
```
Closes https://github.com/facebook/yoga/pull/393
Reviewed By: emilsjolander
Differential Revision: D4550382
Pulled By: dshahidehpour
fbshipit-source-id: 76d797d1e0de8e5dc767e02180a7fc440a70212e
Summary:
To date, our sample project was lacking. There is still a lot of work that can be done to improve, but, this is a step in the right direction.
Here are the changes in this commit:
1. The project is written in Swift.
2. Created new CollectionView (via [IGListKit](https://github.com/instagram/iglistkit)), making it very easy to add new examples.
3. New examples for basic layouts, and including/excluding layouts on the fly.
Here's a video!

Closes https://github.com/facebook/yoga/pull/392
Reviewed By: emilsjolander
Differential Revision: D4550379
Pulled By: dshahidehpour
fbshipit-source-id: 64a07acf96c1887f1d2ad0c54971fcedb64334a0