7 Commits

Author SHA1 Message Date
Michael Schneider
097790317e
Yoga integration improvements (#1187)
* Thread safety for Yoga layout

* Support baseline alignments for ASYogaLayout

* Refactor ASLayoutElementYogaBaselineFunc to not require yogaParent (its parent style is set into a private var on ASLayoutElementStyle before layout instead)

* Only set the accessibility element if the view is loaded

* Add nodeWillCalculateLayout to ASNodeController

* Update Changelog

* Address first comments
2018-10-24 10:27:58 -07:00
appleguy
465abb1ded [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077)
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)

With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.

After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.

* [License] Update all Texture source files to be pure Apache 2.

* Changelog entry for Apache 2 license update.

* Revert "[License] Update all Texture source files to be pure Apache 2."

This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.

* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.

* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
2018-08-28 07:39:18 -07:00
Adlai Holler
dbe469a94a
Standardize "extern" decls on AS_EXTERN (#972)
* Standardize "extern" decls on AS_EXTERN

* Rebase & remove from implementation files
2018-06-18 15:53:34 -07:00
appleguy
cfc48679ba [Yoga] Add insertYogaNode:atIndex: method. Improve handling of relayouts. (#469)
* [Yoga] Add insertYogaNode:atIndex: method. Improve handling of relayouts.

* Add new "version" parameter to Yoga initialization of ASDisplayNodeLayout C++ struct.
2017-09-17 22:45:39 -07:00
appleguy
486410d7d6 [Yoga] Minimize number of nodes that have MeasureFunc set on them. (#369)
This has one important benefit: fixing the stretching behavior of spacer nodes.

In addition, it should help efficiency of Yoga and certainly minimize calls
to layoutThatFits:.

Next up for Yoga is a mostly-red diff, deleting the non-Contiguous code branches.
2017-06-18 18:18:12 -07:00
appleguy
55928f343d [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with improved behavior and cleaner integration (#343)
* [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with support for mixing with ASLayoutSpec.

After experimentation with the ASYogaLayoutSpec (or non-contiguous) approach to
integrating Yoga, test results and feedback from the authors of Yoga have shown
that this approach can't be made completely correct,

There are issues with some of the features required to represent Web-style
flexbox; in particular: padding, margins, and border handling have varience.

This diff is a first step towards a truly correct and elegant implementation of
Yoga integration with Texture. In addition to reducing the footprint of
the integration, which is an explicit goal of work at this stage, these changes
already support improved behavior - including mixing between ASLayoutSpecs
even as subnodes of Yoga layout-driven nodes, in addition to above them. Yoga
may be used for any set of nodes.

Because Yoga usage is limited at this time, it's safe to merge this diff and
further improvements will be refinements in this direction.

* [ASDKgram] Add Yoga layout implementation for PhotoCellNode.

* [Yoga] Final fixes for the upgraded implementation of the Contiguous layout mode.

* [Yoga] Add CHANGELOG.md entry and fix for Yoga rounding to screen scale.

* [Yoga] Minor cleanup to remove old comments and generalize utility methods.
2017-06-14 19:36:13 -07:00
appleguy
b285ece35f [Yoga] Implement ASYogaLayoutSpec, a simplified integration strategy for Yoga. (#270)
* [Yoga] Implement ASYogaLayoutSpec, an experimental alternative to full-tree integration.

This approach allows us to avoid any ASDisplayNode.mm integration points.
However, it is not yet proven to be possible to achieve correctness with this approach.

The entry point (to start calculating), and the measurement function inputs, lack
the full expressiveness of ASSizeRange; we need to make sure that workarounds like
using style.minSize are successful in simulating the behavior of a full Yoga tree.

* [Yoga] Fix file comments, move towards <ASLayoutElement> support.

* [Yoga] Important fix for simplified, non-contiguous Yoga integration.

* [Yoga] Complete implementation of manual memory management (__bridge_transfer, YGNodeFree)
2017-05-29 15:39:24 -07:00