Commit Graph

36 Commits

Author SHA1 Message Date
Sophie Alpert
a2b6ddb7b1 Update license headers for MIT license
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
2018-02-16 18:27:33 -08:00
Jonathan Kim
2a10337344 Consolidate mobile yoga into top-level xplat
Reviewed By: emilsjolander

Differential Revision: D6494379

fbshipit-source-id: f6b78d8a1b3d4bcdeef350ad7bd097cdbe5d15b1
2017-12-13 15:08:03 -08:00
Taras Tsugrii
dec1172f38 Migrate yoga defs to Skylark syntax.
Summary: https://our.intern.facebook.com/intern/dex/buck/python-to-skylark/

Reviewed By: adamjernst

Differential Revision: D6411822

fbshipit-source-id: 2abe2c183d1b1a28349d0c7bd765754688ec4441
2017-11-27 14:00:52 -08:00
Pascal Hartig
40861c699e Modernize Android build system, bump dependencies
Summary:
- Build against Android SDK 26
- Upgrade to Gradle 4
- Upgrade to Android Plugin 3.0, adjust dependency management accordingly
- Upgrade Maven deployment plugin

Reviewed By: emilsjolander

Differential Revision: D6272007

fbshipit-source-id: b198b4c8e1a94e2ee031ad26193fdfdf5b52adf1
2017-11-08 09:47:26 -08:00
Pascal Hartig
ae33c6c19c Update Maven release scripts
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
2017-05-09 03:41:51 -07:00
Aurimas
40eba60cf5 Move from ActionBarActivity to AppCompatActivity
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
2017-05-02 09:27:18 -07:00
Aurimas
fb4cfed20d Move from ActionBarActivity to AppCompatActivity
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
2017-05-02 09:27:18 -07:00
Daniel Wagner-Hall
2ffc23f400 Remove project_config rules
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
2017-04-25 08:04:02 -07:00
Pascal Hartig
eacf3cdbb4 Bump gradle and android dependencies
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
2017-04-19 10:56:48 -07:00
Emil Sjolander
1b3e971549 Remove references to CSSLayoutDEPRECATED
Summary: Remove references to CSSLayoutDEPRECATED from litho

Reviewed By: marco-cova

Differential Revision: D4859822

fbshipit-source-id: 2588c1b3334f28332ae43e6c0bdec65934ca84c4
2017-04-13 12:45:23 -07:00
Emil Sjolander
c080a46571 Fix some issues with the deploy script and deploy a new version for android
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
2017-04-12 09:56:42 -07:00
Emil Sjolander
5f050cb590 Bump version of android stuff
Summary: Bump version of android things

Reviewed By: passy

Differential Revision: D4875213

fbshipit-source-id: 2b229a0dade521ef745852c0096545e7e9fe2c1e
2017-04-12 03:43:45 -07:00
birfincankafein
f66f52d1ba Make YogaLayout create programmatically. Make YogaNode of YogaLayout …
Summary:
Make YogaLayout constructible programmatically.
Make YogaLayout's YogaNode accessible from outside.
Closes https://github.com/facebook/yoga/pull/436

Differential Revision: D4850451

Pulled By: emilsjolander

fbshipit-source-id: 2821a6ef4160854244c0227a3c4c96369f7b2e64
2017-04-07 02:12:25 -07:00
Lukas Wöhrl
34726a9926 Fix xmlns import for android yoga library
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
2017-03-30 09:32:11 -07:00
Robert Spencer
794b6b35ce YogaLayout perf tests
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
2017-03-15 09:11:24 -07:00
Robert Spencer
0445962bd4 Use camelCase for attributes
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
2017-03-09 06:26:34 -08:00
Robert Spencer
61595763b0 Use SVGs for all badges
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
2017-03-07 09:11:14 -08:00
Robert Spencer
f6ecc8da7b Update readme with badges and YogaLayout badges
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
2017-03-07 06:56:26 -08:00
Robert Spencer
32792a0de5 Gradle versionbump
Summary: Version 1.3

Reviewed By: emilsjolander

Differential Revision: D4666239

fbshipit-source-id: fad4b97b9947342ac91718d4f261184e7baf334a
2017-03-07 06:56:26 -08:00
Robert Spencer
abf912b729 Gradle version bump and POM details
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
2017-03-07 03:56:46 -08:00
Robert Spencer
29fd447f0c Margin percent values should be floats
Summary: Percentages should be floats

Reviewed By: emilsjolander

Differential Revision: D4642511

fbshipit-source-id: f1ef78259cf967acec9b82d77e43d7b9ad263e5b
2017-03-03 06:48:10 -08:00
Robert Spencer
7047d96087 Add yg prefix to attributes
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
2017-03-03 00:41:04 -08:00
Robert Spencer
6336e641f4 Add ability to invalidate views
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
2017-03-02 02:58:52 -08:00
Robert Spencer
b940fadb7e Add android bindings to margin:auto
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
2017-03-01 05:57:03 -08:00
Robert Spencer
4372aa16d3 Enable RTL on sample app
Summary: The manifest didn't acknowledge that the sample app supports RTL.  Thus `TextView`s didn't render properly.

Reviewed By: emilsjolander

Differential Revision: D4628867

fbshipit-source-id: 72e57f48f7d68a8d2d6dd091b44b9452a3fe281a
2017-02-28 12:27:15 -08:00
Robert Spencer
533f560ce0 Android bindings for display property
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
2017-02-28 00:26:27 -08:00
Michael Bolin
47d8d9d22b Apply auto-formatter for BUCK files in fbandroid.
Summary:
For more background, see:

https://fb.facebook.com/groups/303159406399348/permalink/1334977403217538/
https://fburl.com/auto-format-build-files
D4527873

fbshipit-source-id: 278ce6f67f5df830b2218e3aca69be103d3c56a6
2017-02-24 21:44:02 -08:00
birfincankafein
3ad4d7dd6e Solve build target error while building Android with Buck.
Summary:
SoLoader library targets Android API 21 but main manifest targets 19. This will block buck android build.
Closes https://github.com/facebook/yoga/pull/437

Reviewed By: astreet

Differential Revision: D4611364

Pulled By: emilsjolander

fbshipit-source-id: 113bcfce751e98b8a42e46e0101b6a4b1327b9c3
2017-02-24 03:26:46 -08:00
Robert Spencer
60ffa1953b Gradle for android library
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
2017-02-23 05:07:20 -08:00
Robert Spencer
5519a73087 Gradle for java library
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
2017-02-23 05:07:20 -08:00
Robert Spencer
d7ca339c27 Fix android height attribute
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
2017-02-21 00:12:09 -08:00
Robert Spencer
521aab5fcc Omptimisation on layout and measure children of YogaLayout
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
2017-02-19 23:58:09 -08:00
Robert Spencer
fbd692c449 Remove splash screen activity from sample app
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
2017-02-16 02:44:50 -08:00
Robert Spencer
a66339d63c Separate YogaLayout library from sample app
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
2017-02-14 08:13:22 -08:00
Robert Spencer
d24078be31 Move res files to be more gradle-esque
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
2017-02-14 03:14:59 -08:00
Robert Spencer
a580712b2f Move in yoga sample android app
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
2017-02-14 00:11:38 -08:00