Summary: This change drops the year from the copyright headers and the LICENSE file.
Reviewed By: yungsters
Differential Revision: D9727774
fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
Summary:
This uses the latest version of `buildifier` that supports many
more Skylark syntax features.
Reviewed By: yfeldblum
Differential Revision: D8073585
fbshipit-source-id: 12322aebc09b89d5af9cc257b16c1bc0fbb066c1
Summary:
In the persistent version of Yoga, a YogaNode can be shared between two YogaTrees, that means that a YogaNode could have more than one Parent at one point in time. That's why the concept of Parent of a YogaNode is not a 1-1 relationship anymore.
This diff changes the semantic of Parent of a YogaNode to Owner of a Yoga Node. CC sebmarkbage and priteshrnandgaonkar for more context.
Technically this diff renames the field YogaNode.parent to YogaNode.owner (and every internal field, Getter and Setter that is related to parent)
Note that as part of this diff I also modified the CSSLayoutDEPRECATED version of Yoga in order to keep compatibility with the C++ implementation.
Reviewed By: priteshrnandgaonkar
Differential Revision: D7352778
fbshipit-source-id: dcf1af5e72bfc3063b5c4bda197d7952a9194768
Summary:
emilsjolander hi,
this PR solves the following common and probable layout pixel scenario:
the older code is presented for reference:
```java
view.measure(
View.MeasureSpec.makeMeasureSpec(
Math.round(node.getLayoutWidth()),
View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(
Math.round(node.getLayoutHeight()),
View.MeasureSpec.EXACTLY));
view.layout(
Math.round(xOffset + node.getLayoutX()),
Math.round(yOffset + node.getLayoutY()),
Math.round(xOffset + node.getLayoutX() + node.getLayoutWidth()),
Math.round(yOffset + node.getLayoutY() + node.getLayoutHeight()));
```
suppose now the following:
- `xOffset + node.getLayoutX() = 2.2`
- `node.getLayoutWidth() = 0.4` ==> `Math.round(node.getLayoutWidth()) = 0`
- `Math.round(xOffset + node.getLayoutX() + node.getLayoutWidth()) = Math.round(2.2 + 0.4) = 3`
this induces, the following measurements:
```java
view.measure(
View.MeasureSpec.makeMeasureSpec(
0,
View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(
Math.round(node.getLayoutHeight()),
View.MeasureSpec.EXACTLY));
view.layout(
2,
Math.round(yOffset + node.getLayoutY()),
3,
Math.round(yOffset + node.getLayoutY() + node.getLayoutHeight()));
```
the width measurement of the view is 0, while the layout is `(3 - 2 = 1)`.
my proposed solution is to measure the view the way it is now, but when layouting
I use the `#getMeasuredWidth/Height()` methods, this will stop this problem
from happening.
I also want to note that this bug happens with high probability.
Closes https://github.com/facebook/yoga/pull/712
Reviewed By: emilsjolander
Differential Revision: D7231798
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 171da519639dbecd75416a574bccc4456aa22f31
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
Summary:
Reuse the gradle setup we've built for Litho which allows for parallel publishing to Bintray and Maven Central in addition to Sonatype Snapshots.
This appears not to break the existing jcenter deploy script which is pretty great.
Reviewed By: emilsjolander
Differential Revision: D5020576
fbshipit-source-id: 3ef163ccbfe91c6858b051d39dcf237ca388e18d
Summary:
ActionBarActivity has been deprecated for 2+ years now.
Closes https://github.com/facebook/yoga/pull/538
Differential Revision: D4985973
Pulled By: emilsjolander
fbshipit-source-id: 09f2a8a12943c9b3ccdaee9cac684276b42ff843
Summary:
ActionBarActivity has been deprecated for 2+ years now.
Closes https://github.com/facebook/yoga/pull/539
Differential Revision: D4985970
Pulled By: emilsjolander
fbshipit-source-id: 2e2fcc5188c08ef1cd78f7e1be71917f0395ff2c
Summary:
These only exist to support a deprecated form of project generation which is
about to be removed.
Reviewed By: marcinkosiba
Differential Revision: D4945841
fbshipit-source-id: 3d35b8f8cd902572995ee4f55f9b5930efa186ec
Summary:
We need to use the most recent Android SDK to leverage the cmake-based NDK build
system. Also, since everything seems to be still working - why not?
I also changed the dependency of `yoga-layout` to be the project, not the
pre-published artifact as it no longer compiled due to the changed measure API
signature. I'm not sure if there was a reason to keep the two separate.
By relying on Maven-published artifacts, we generate better POMs when publishing
and people can override dependencies and see them more easily.
A few more cleanups based on what we did with Litho.
Reviewed By: emilsjolander
Differential Revision: D4913208
fbshipit-source-id: 053deb444ce91106afb3b66c3be28d6fcbdea450
Summary: Fix some issues with the deploy script and deploy a new version for android
Reviewed By: passy
Differential Revision: D4876006
fbshipit-source-id: ddafb8349e1c77ab5afd9a823103fb6a1dfabb1d
Summary: Bump version of android things
Reviewed By: passy
Differential Revision: D4875213
fbshipit-source-id: 2b229a0dade521ef745852c0096545e7e9fe2c1e
Summary:
Fix xmlns import for yoga library by using `apk` instead of `lib` in the comment.
Closes https://github.com/facebook/yoga/pull/495
Reviewed By: emilsjolander
Differential Revision: D4802918
Pulled By: rspencer01
fbshipit-source-id: 9cef7709606e30e8e30af6e396866ac4900168bf
Summary: We would like to know some numbers on benchmarking `YogaLayout` against other layouts, particularly `LinearLayout`. This implements a `BenchmarkActivity` to fill that need.
Reviewed By: emilsjolander
Differential Revision: D4565531
fbshipit-source-id: fe1c558beb603c3116ac3d0dd6654b0376dd6b8a
Summary: The android standard is `prefix_camelCase` such as `layout_marginLeft`. This changes attributes like `yg_margin_left` to `yg_marginLeft`.
Reviewed By: emilsjolander
Differential Revision: D4681514
fbshipit-source-id: 76a80c24f19f3ee52329a2a254fe1f5fbcb40b9c
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: 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: 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: [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: 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: 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: 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:
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: 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: 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: 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: 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