Compare commits
63 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b5c2b09780 | ||
|
46817a38c3 | ||
|
52f3471405 | ||
|
e567502750 | ||
|
c1cdc1de58 | ||
|
f2c41f366f | ||
|
56d06e27cf | ||
|
93e327f4a5 | ||
|
687668a4b3 | ||
|
cfeac79130 | ||
|
4227e36ca5 | ||
|
be1c9f249e | ||
|
511a129a7e | ||
|
d62ca8c518 | ||
|
30413265c7 | ||
|
bd5d8a77c9 | ||
|
326ae15532 | ||
|
9afb65da34 | ||
|
fe7643c84a | ||
|
6daad3ae66 | ||
|
44590b8907 | ||
|
4400b52aab | ||
|
c217553cf8 | ||
|
6ad5003149 | ||
|
7c77b0e48c | ||
|
7b36118df4 | ||
|
7f0dbe5356 | ||
|
b87fc217df | ||
|
625dc4bf44 | ||
|
34736a4929 | ||
|
4f37cde043 | ||
|
7df60376ff | ||
|
7fa4adb0d9 | ||
|
abb91ae77b | ||
|
a4b1ac83f4 | ||
|
8775cdc13f | ||
|
db732ce9fa | ||
|
7c09244c39 | ||
|
2cc2a5f2ff | ||
|
e4b50f2a8d | ||
|
a2a84532ff | ||
|
d391323129 | ||
|
ab28ecf31b | ||
|
a4bab68802 | ||
|
e3cfacf0cb | ||
|
8d74e01f41 | ||
|
5404bb13d4 | ||
|
be8773fee0 | ||
|
0bcec80dfe | ||
|
2c8c2bffda | ||
|
d70f289e73 | ||
|
498a5980e8 | ||
|
8021c5d968 | ||
|
c536ab214d | ||
|
adb81e2a1e | ||
|
c4a3e12add | ||
|
a3d7d72421 | ||
|
47266b9ae8 | ||
|
e39f13a8ea | ||
|
c04604dbc0 | ||
|
1782646723 | ||
|
78e64e3d5b | ||
|
0acb620159 |
17
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Report
|
||||
|
||||
- [ ] I have searched [existing issues](https://github.com/facebook/yoga/issues) and this is not a duplicate
|
||||
|
||||
# Issues and Steps to Reproduce
|
||||
***Replaces this with steps to repro your issue.***
|
||||
|
||||
# Expected Behavior
|
||||
***Describe what you expected would happen.***
|
||||
|
||||
# Actual Behavior
|
||||
***Describe what actually happened.***
|
||||
|
||||
# Link to Code
|
||||
***If you have some code that maintainers can clone/test for themselves, bugs can be resolved much faster. Please paste a link here.***
|
||||
|
||||
***When applicable, use this [fiddle](https://jsfiddle.net/emilsjolander/jckmwztt/) to post a web repro.***
|
4
.gitignore
vendored
@@ -7,6 +7,10 @@
|
||||
/gentest/test.html
|
||||
.buckversion
|
||||
|
||||
# Jekyll
|
||||
/.sass-cache/
|
||||
/_site/
|
||||
|
||||
# Visual studio code
|
||||
.vscode
|
||||
*.pdb
|
||||
|
58
.hgignore
@@ -1,58 +0,0 @@
|
||||
.DS_STORE
|
||||
|
||||
/buck-cache/
|
||||
/buck-out/
|
||||
/.buckconfig.local
|
||||
/.buckd
|
||||
/gentest/test.html
|
||||
.buckversion
|
||||
|
||||
# Visual studio code
|
||||
.vscode
|
||||
*.pdb
|
||||
*.tlog
|
||||
*.obj
|
||||
*.pch
|
||||
*.log
|
||||
*.orig
|
||||
|
||||
# Xcode
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData/
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata/
|
||||
|
||||
## Other
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.dSYM.zip
|
||||
*.dSYM
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
Pods/
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
1
.swift-version
Normal file
@@ -0,0 +1 @@
|
||||
3.0
|
@@ -6,7 +6,7 @@
|
||||
# of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
os: osx
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8.2
|
||||
language: cpp
|
||||
compiler: clang
|
||||
|
||||
@@ -29,7 +29,7 @@ install:
|
||||
script:
|
||||
- buck test //:yoga
|
||||
- buck test //java:java
|
||||
- buck test //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI
|
||||
- buck test //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64
|
||||
- sh csharp/tests/Facebook.Yoga/test_macos.sh
|
||||
|
||||
- cd javascript
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Yoga [](https://travis-ci.org/facebook/yoga)
|
||||
# Yoga [](https://travis-ci.org/facebook/yoga) [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout)
|
||||
|
||||
## Building
|
||||
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
||||
@@ -27,4 +27,4 @@ You may need to install the latest watir-webdriver gem (`gem install watir-webdr
|
||||
For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run `bash format.sh` before submitting a pull request. For other languages just try to follow the current code style.
|
||||
|
||||
## Benchmarks
|
||||
Benchmarks are located in `benchmarks/YGBenchmark.c` and can be run with `buck run //benchmarks:benchmarks`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
||||
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
||||
|
28
Yoga.podspec
Normal file
@@ -0,0 +1,28 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'Yoga'
|
||||
spec.version = '1.0.2'
|
||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/'
|
||||
|
||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||||
|
||||
spec.authors = 'Facebook'
|
||||
spec.source = {
|
||||
:git => 'https://github.com/facebook/yoga.git',
|
||||
:tag => 'v2017.01.27.00',
|
||||
}
|
||||
|
||||
spec.module_name = 'yoga'
|
||||
spec.requires_arc = false
|
||||
spec.compiler_flags = [
|
||||
'-fno-omit-frame-pointer',
|
||||
'-fexceptions',
|
||||
'-Wall',
|
||||
'-Werror',
|
||||
'-std=c11',
|
||||
'-fPIC'
|
||||
]
|
||||
spec.source_files = 'yoga/**/*.{c,h}'
|
||||
end
|
29
YogaKit.podspec
Normal file
@@ -0,0 +1,29 @@
|
||||
podspec = Pod::Spec.new do |spec|
|
||||
spec.name = 'YogaKit'
|
||||
spec.version = '1.0.3'
|
||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
|
||||
|
||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||||
|
||||
spec.authors = 'Facebook'
|
||||
spec.source = {
|
||||
:git => 'https://github.com/facebook/yoga.git',
|
||||
:tag => 'v2017.01.27.00',
|
||||
}
|
||||
|
||||
spec.platform = :ios
|
||||
spec.ios.deployment_target = '8.0'
|
||||
spec.ios.frameworks = 'UIKit'
|
||||
|
||||
spec.dependency 'Yoga', '~> 1.0'
|
||||
spec.source_files = 'YogaKit/Source/*.{h,m}'
|
||||
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
||||
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
||||
end
|
||||
|
||||
# See https://github.com/facebook/yoga/pull/366
|
||||
podspec.attributes_hash["readme"] = "YogaKit/README.md"
|
||||
podspec
|
1
YogaKit/.swift-version
Normal file
@@ -0,0 +1 @@
|
||||
3.0.2
|
@@ -30,8 +30,8 @@ COMPILER_FLAGS = [
|
||||
apple_library(
|
||||
name = 'YogaKit',
|
||||
compiler_flags = COMPILER_FLAGS,
|
||||
srcs = glob(['*.m']),
|
||||
exported_headers = glob(['*.h']),
|
||||
srcs = glob(['Source/**/*.m']),
|
||||
exported_headers = glob(['Source/**/*.h']),
|
||||
frameworks = [
|
||||
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
|
||||
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
|
||||
|
22
YogaKit/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# YogaKit
|
||||
|
||||
[](https://cocoapods.org/pods/YogaKit)
|
||||
[](https://facebook.github.io/yoga/docs/api/yogakit/)
|
||||
[](https://facebook.github.io/yoga/docs/api/yogakit/)
|
||||
|
||||
## Installation
|
||||
YogaKit is available to install via [CocoaPods](https://cocoapods.org/).
|
||||
|
||||
```
|
||||
pod 'YogaKit', '~> 1.0.2'
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
Checkout the docs [here](https://facebook.github.io/yoga/docs/api/yogakit/).
|
||||
|
||||
We also have a sample project. To try it out, clone this repo and open `YogaKitSample.xcodeproj` in the [YogaKitSample](https://github.com/facebook/yoga/tree/master/YogaKit/YogaKitSample) directory.
|
||||
|
||||
## Contributing
|
||||
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
|
||||
|
||||
See the [CONTRIBUTING](https://github.com/facebook/yoga/blob/master/CONTRIBUTING) file for how to help out.
|
@@ -7,8 +7,8 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YGLayout.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIView (Yoga)
|
||||
|
@@ -8,8 +8,11 @@
|
||||
*/
|
||||
|
||||
#import "YGLayout.h"
|
||||
#import <yoga/Yoga.h>
|
||||
|
||||
@interface YGLayout (Private)
|
||||
@interface YGLayout ()
|
||||
|
||||
@property (nonatomic, assign, readonly) YGNodeRef node;
|
||||
|
||||
- (instancetype)initWithView:(UIView *)view;
|
||||
|
@@ -18,7 +18,8 @@
|
||||
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
||||
|
||||
/**
|
||||
The property that decides during layout/sizing whether or not styling properties should be applied. Defaults to NO.
|
||||
The property that decides during layout/sizing whether or not styling properties should be applied.
|
||||
Defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, readwrite, assign, setter=setEnabled:) BOOL isEnabled;
|
||||
|
||||
@@ -31,6 +32,7 @@
|
||||
@property (nonatomic, readwrite, assign) YGPositionType position;
|
||||
@property (nonatomic, readwrite, assign) YGWrap flexWrap;
|
||||
@property (nonatomic, readwrite, assign) YGOverflow overflow;
|
||||
@property (nonatomic, readwrite, assign) YGDisplay display;
|
||||
|
||||
@property (nonatomic, readwrite, assign) CGFloat flexGrow;
|
||||
@property (nonatomic, readwrite, assign) CGFloat flexShrink;
|
||||
@@ -84,7 +86,7 @@
|
||||
/**
|
||||
Get the resolved direction of this node. This won't be YGDirectionInherit
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) YGDirection resolvedDirection;
|
||||
@property (nonatomic, readonly, assign) YGDirection resolvedDirection;
|
||||
|
||||
/**
|
||||
Perform a layout calculation and update the frames of the views in the hierarchy with the results
|
||||
@@ -92,19 +94,21 @@
|
||||
- (void)applyLayout NS_SWIFT_NAME(applyLayout());
|
||||
|
||||
/**
|
||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self
|
||||
sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||
|
||||
/**
|
||||
Returns the number of children that are using Flexbox.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
||||
@property (nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
||||
|
||||
/**
|
||||
Return a BOOL indiciating whether or not we this node contains any subviews that are included in Yoga's layout.
|
||||
Return a BOOL indiciating whether or not we this node contains any subviews that are included in
|
||||
Yoga's layout.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) BOOL isLeaf;
|
||||
@property (nonatomic, readonly, assign) BOOL isLeaf;
|
||||
|
||||
/**
|
||||
Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
@@ -9,9 +9,8 @@
|
||||
|
||||
#import "YGLayout+Private.h"
|
||||
#import "UIView+Yoga.h"
|
||||
#import <yoga/Yoga.h>
|
||||
|
||||
#define YG_STYLE_PROPERTY_IMPL(type, lowercased_name, capitalized_name) \
|
||||
#define YG_PROPERTY(type, lowercased_name, capitalized_name) \
|
||||
- (type)lowercased_name \
|
||||
{ \
|
||||
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||
@@ -22,16 +21,7 @@
|
||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_STYLE_EDGE_PROPERTY_IMPL(lowercased_name, capitalized_name, property, edge) \
|
||||
- (CGFloat)lowercased_name { \
|
||||
return YGNodeStyleGet##property(self.node, edge); \
|
||||
} \
|
||||
\
|
||||
- (void)set##capitalized_name:(CGFloat)lowercased_name { \
|
||||
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_STYLE_VALUE_PROPERTY_IMPL(lowercased_name, capitalized_name) \
|
||||
#define YG_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||
- (CGFloat)lowercased_name \
|
||||
{ \
|
||||
YGValue value = YGNodeStyleGet##capitalized_name(self.node); \
|
||||
@@ -47,37 +37,71 @@
|
||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, edge, edge_suffix) \
|
||||
- (CGFloat)lowercased_name##edge_suffix \
|
||||
#define YG_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
||||
- (CGFloat)lowercased_name \
|
||||
{ \
|
||||
YGValue value = YGNodeStyleGet##capitalized_name(self.node, edge); \
|
||||
return YGNodeStyleGet##property(self.node, edge); \
|
||||
}
|
||||
|
||||
#define YG_SHORTHAND_EDGE_PROPERTY_GETTER(lowercased_name) \
|
||||
- (CGFloat)lowercased_name \
|
||||
{ \
|
||||
return YGUndefined; \
|
||||
}
|
||||
|
||||
#define YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge) \
|
||||
- (void)set##capitalized_name:(CGFloat)lowercased_name \
|
||||
{ \
|
||||
YGNodeStyleSet##property(self.node, edge, lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||
|
||||
#define YG_SHORTHAND_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_SHORTHAND_EDGE_PROPERTY_GETTER(lowercased_name) \
|
||||
YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||
|
||||
#define YG_VALUE_EDGE_PROPERTY_GETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
||||
- (CGFloat)objc_lowercased_name \
|
||||
{ \
|
||||
YGValue value = YGNodeStyleGet##c_name(self.node, edge); \
|
||||
if (value.unit == YGUnitPixel) { \
|
||||
return value.value; \
|
||||
} else { \
|
||||
return YGUndefined; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
- (void)set##capitalized_name##edge_suffix:(CGFloat)lowercased_name \
|
||||
{ \
|
||||
YGNodeStyleSet##capitalized_name(self.node, edge, lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_STYLE_ALL_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeLeft, Left) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeTop, Top) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeRight, Right) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeBottom, Bottom) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeStart, Start) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeEnd, End) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeHorizontal, Horizontal) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeVertical, Vertical) \
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeAll, )
|
||||
#define YG_VALUE_EDGE_PROPERTY_SETTER(objc_lowercased_name, objc_capitalized_name, c_name, edge) \
|
||||
- (void)set##objc_capitalized_name:(CGFloat)objc_lowercased_name \
|
||||
{ \
|
||||
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name); \
|
||||
}
|
||||
|
||||
#define YG_VALUE_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_VALUE_EDGE_PROPERTY_GETTER(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_VALUE_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||
|
||||
#define YG_VALUE_SHORTHAND_EDGE_PROPERTY(lowercased_name, capitalized_name, property, edge) \
|
||||
YG_SHORTHAND_EDGE_PROPERTY_GETTER(lowercased_name) \
|
||||
YG_VALUE_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
||||
|
||||
#define YG_VALUE_EDGES_PROPERTIES(lowercased_name, capitalized_name) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Left, capitalized_name##Left, capitalized_name, YGEdgeLeft) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Top, capitalized_name##Top, capitalized_name, YGEdgeTop) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Right, capitalized_name##Right, capitalized_name, YGEdgeRight) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Bottom, capitalized_name##Bottom, capitalized_name, YGEdgeBottom) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##Start, capitalized_name##Start, capitalized_name, YGEdgeStart) \
|
||||
YG_VALUE_EDGE_PROPERTY(lowercased_name##End, capitalized_name##End, capitalized_name, YGEdgeEnd) \
|
||||
YG_VALUE_SHORTHAND_EDGE_PROPERTY(lowercased_name##Horizontal, capitalized_name##Horizontal, capitalized_name, YGEdgeHorizontal) \
|
||||
YG_VALUE_SHORTHAND_EDGE_PROPERTY(lowercased_name##Vertical, capitalized_name##Vertical, capitalized_name, YGEdgeVertical) \
|
||||
YG_VALUE_SHORTHAND_EDGE_PROPERTY(lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
|
||||
|
||||
@interface YGLayout ()
|
||||
|
||||
@property (nonatomic, weak, readonly) UIView *view;
|
||||
@property (nonatomic, assign, readonly) YGNodeRef node;
|
||||
|
||||
@end
|
||||
|
||||
@@ -85,6 +109,7 @@ YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeAll, )
|
||||
|
||||
@synthesize isEnabled=_isEnabled;
|
||||
@synthesize isIncludedInLayout=_isIncludedInLayout;
|
||||
@synthesize node=_node;
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
@@ -148,43 +173,44 @@ YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(lowercased_name, capitalized_name, YGEdgeAll, )
|
||||
YGNodeStyleSetPositionType(self.node, position);
|
||||
}
|
||||
|
||||
YG_STYLE_PROPERTY_IMPL(YGDirection, direction, Direction)
|
||||
YG_STYLE_PROPERTY_IMPL(YGFlexDirection, flexDirection, FlexDirection)
|
||||
YG_STYLE_PROPERTY_IMPL(YGJustify, justifyContent, JustifyContent)
|
||||
YG_STYLE_PROPERTY_IMPL(YGAlign, alignContent, AlignContent)
|
||||
YG_STYLE_PROPERTY_IMPL(YGAlign, alignItems, AlignItems)
|
||||
YG_STYLE_PROPERTY_IMPL(YGAlign, alignSelf, AlignSelf)
|
||||
YG_STYLE_PROPERTY_IMPL(YGWrap, flexWrap, FlexWrap)
|
||||
YG_STYLE_PROPERTY_IMPL(YGOverflow, overflow, Overflow)
|
||||
YG_PROPERTY(YGDirection, direction, Direction)
|
||||
YG_PROPERTY(YGFlexDirection, flexDirection, FlexDirection)
|
||||
YG_PROPERTY(YGJustify, justifyContent, JustifyContent)
|
||||
YG_PROPERTY(YGAlign, alignContent, AlignContent)
|
||||
YG_PROPERTY(YGAlign, alignItems, AlignItems)
|
||||
YG_PROPERTY(YGAlign, alignSelf, AlignSelf)
|
||||
YG_PROPERTY(YGWrap, flexWrap, FlexWrap)
|
||||
YG_PROPERTY(YGOverflow, overflow, Overflow)
|
||||
YG_PROPERTY(YGDisplay, display, Display)
|
||||
|
||||
YG_STYLE_PROPERTY_IMPL(CGFloat, flexGrow, FlexGrow)
|
||||
YG_STYLE_PROPERTY_IMPL(CGFloat, flexShrink, FlexShrink)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(flexBasis, FlexBasis)
|
||||
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
||||
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
||||
YG_VALUE_PROPERTY(flexBasis, FlexBasis)
|
||||
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeLeft, Left)
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeTop, Top)
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeRight, Right)
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeBottom, Bottom)
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeStart, Start)
|
||||
YG_STYLE_EDGE_PROPERTY_UNIT_IMPL(position, Position, YGEdgeEnd, End)
|
||||
YG_STYLE_ALL_EDGE_PROPERTY_UNIT_IMPL(margin, Margin)
|
||||
YG_STYLE_ALL_EDGE_PROPERTY_UNIT_IMPL(padding, Padding)
|
||||
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
||||
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
||||
YG_VALUE_EDGE_PROPERTY(right, Right, Position, YGEdgeRight)
|
||||
YG_VALUE_EDGE_PROPERTY(bottom, Bottom, Position, YGEdgeBottom)
|
||||
YG_VALUE_EDGE_PROPERTY(start, Start, Position, YGEdgeStart)
|
||||
YG_VALUE_EDGE_PROPERTY(end, End, Position, YGEdgeEnd)
|
||||
YG_VALUE_EDGES_PROPERTIES(margin, Margin)
|
||||
YG_VALUE_EDGES_PROPERTIES(padding, Padding)
|
||||
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderLeftWidth, BorderLeftWidth, Border, YGEdgeLeft)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderTopWidth, BorderTopWidth, Border, YGEdgeTop)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderRightWidth, BorderRightWidth, Border, YGEdgeRight)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderBottomWidth, BorderBottomWidth, Border, YGEdgeBottom)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderStartWidth, BorderStartWidth, Border, YGEdgeStart)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
||||
YG_STYLE_EDGE_PROPERTY_IMPL(borderWidth, BorderWidth, Border, YGEdgeAll)
|
||||
YG_EDGE_PROPERTY(borderLeftWidth, BorderLeftWidth, Border, YGEdgeLeft)
|
||||
YG_EDGE_PROPERTY(borderTopWidth, BorderTopWidth, Border, YGEdgeTop)
|
||||
YG_EDGE_PROPERTY(borderRightWidth, BorderRightWidth, Border, YGEdgeRight)
|
||||
YG_EDGE_PROPERTY(borderBottomWidth, BorderBottomWidth, Border, YGEdgeBottom)
|
||||
YG_EDGE_PROPERTY(borderStartWidth, BorderStartWidth, Border, YGEdgeStart)
|
||||
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
||||
YG_SHORTHAND_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
||||
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(width, Width)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(height, Height)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(minWidth, MinWidth)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(minHeight, MinHeight)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(maxWidth, MaxWidth)
|
||||
YG_STYLE_VALUE_PROPERTY_IMPL(maxHeight, MaxHeight)
|
||||
YG_STYLE_PROPERTY_IMPL(CGFloat, aspectRatio, AspectRatio)
|
||||
YG_VALUE_PROPERTY(width, Width)
|
||||
YG_VALUE_PROPERTY(height, Height)
|
||||
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
||||
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
||||
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
||||
YG_VALUE_PROPERTY(maxHeight, MaxHeight)
|
||||
YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
||||
|
||||
#pragma mark - Layout and Sizing
|
||||
|
@@ -10,47 +10,53 @@
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#import <YogaKit/UIView+Yoga.h>
|
||||
#import <YogaKit/YGLayout+Private.h>
|
||||
#import <yoga/Yoga.h>
|
||||
|
||||
@interface YogaKitTests : XCTestCase
|
||||
@end
|
||||
|
||||
@implementation YogaKitTests
|
||||
|
||||
#ifndef TRAVIS_CI
|
||||
|
||||
- (void)testNodesAreDeallocedWithSingleView
|
||||
{
|
||||
XCTAssertEqual(0, YGNodeGetInstanceCount());
|
||||
__weak YGLayout *layoutRef = nil;
|
||||
|
||||
@autoreleasepool {
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
view.yoga.flexBasis = 1;
|
||||
XCTAssertEqual(1, YGNodeGetInstanceCount());
|
||||
view = nil;
|
||||
|
||||
XCTAssertEqual(0, YGNodeGetInstanceCount());
|
||||
layoutRef = view.yoga;
|
||||
XCTAssertNotNil(layoutRef);
|
||||
|
||||
view = nil;
|
||||
}
|
||||
|
||||
XCTAssertNil(layoutRef);
|
||||
}
|
||||
|
||||
- (void)testNodesAreDeallocedCascade
|
||||
{
|
||||
XCTAssertEqual(0, YGNodeGetInstanceCount());
|
||||
__weak YGLayout *topLayout = nil;
|
||||
__weak YGLayout *subviewLayout = nil;
|
||||
|
||||
@autoreleasepool {
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
view.yoga.flexBasis = 1;
|
||||
topLayout = view.yoga;
|
||||
topLayout.flexBasis = 1;
|
||||
|
||||
for (int i=0; i<10; i++) {
|
||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
subview.yoga.flexBasis = 1;
|
||||
[view addSubview:subview];
|
||||
}
|
||||
XCTAssertEqual(11, YGNodeGetInstanceCount());
|
||||
view = nil;
|
||||
subviewLayout = subview.yoga;
|
||||
subviewLayout.flexBasis = 1;
|
||||
|
||||
XCTAssertEqual(0, YGNodeGetInstanceCount());
|
||||
view = nil;
|
||||
}
|
||||
|
||||
XCTAssertNil(topLayout);
|
||||
XCTAssertNil(subviewLayout);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
- (void)testUsesYoga
|
||||
- (void)testIsEnabled
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
XCTAssertFalse(view.yoga.isEnabled);
|
||||
@@ -87,13 +93,20 @@
|
||||
|
||||
UIView *textBadgeView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
textBadgeView.yoga.isEnabled = YES;
|
||||
textBadgeView.yoga.marginLeft = 3.0;
|
||||
textBadgeView.yoga.margin = 0;
|
||||
textBadgeView.yoga.width = 10;
|
||||
textBadgeView.yoga.height = 10;
|
||||
[container addSubview:textBadgeView];
|
||||
|
||||
const CGSize textBadgeViewSize = textBadgeView.yoga.intrinsicSize;
|
||||
XCTAssertEqual(textBadgeViewSize.height, 10);
|
||||
XCTAssertEqual(textBadgeViewSize.width, 10);
|
||||
|
||||
const CGSize containerSize = container.yoga.intrinsicSize;
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(514,21), containerSize), @"Size is actually %@", NSStringFromCGSize(containerSize));
|
||||
const CGSize longTextLabelSize = longTextLabel.yoga.intrinsicSize;
|
||||
|
||||
XCTAssertEqual(longTextLabelSize.height, containerSize.height);
|
||||
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
|
||||
}
|
||||
|
||||
- (void)testThatMarkingLeafsAsDirtyWillTriggerASizeRecalculation
|
||||
@@ -110,13 +123,15 @@
|
||||
[container addSubview:label];
|
||||
|
||||
[container.yoga applyLayout];
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(146,21), label.bounds.size), @"Size is actually %@", NSStringFromCGSize(label.bounds.size));
|
||||
CGSize const labelSizeAfterFirstPass = label.frame.size;
|
||||
|
||||
label.text = @"This is a slightly longer text.";
|
||||
XCTAssertTrue(CGSizeEqualToSize(label.frame.size, labelSizeAfterFirstPass));
|
||||
|
||||
[label.yoga markDirty];
|
||||
|
||||
[container.yoga applyLayout];
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(213,21), label.bounds.size), @"Size is actually %@", NSStringFromCGSize(label.bounds.size));
|
||||
XCTAssertFalse(CGSizeEqualToSize(label.frame.size, labelSizeAfterFirstPass));
|
||||
}
|
||||
|
||||
- (void)testFrameAndOriginPlacement
|
||||
@@ -127,18 +142,25 @@
|
||||
container.yoga.isEnabled = YES;
|
||||
container.yoga.flexDirection = YGFlexDirectionRow;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
subview.yoga.isEnabled = YES;
|
||||
subview.yoga.flexGrow = 1;
|
||||
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
subview1.yoga.isEnabled = YES;
|
||||
subview1.yoga.flexGrow = 1;
|
||||
[container addSubview:subview1];
|
||||
|
||||
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
subview2.yoga.isEnabled = YES;
|
||||
subview2.yoga.flexGrow = 1;
|
||||
[container addSubview:subview2];
|
||||
|
||||
UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
subview3.yoga.isEnabled = YES;
|
||||
subview3.yoga.flexGrow = 1;
|
||||
[container addSubview:subview3];
|
||||
|
||||
[container addSubview:subview];
|
||||
}
|
||||
[container.yoga applyLayout];
|
||||
|
||||
XCTAssertFalse(CGRectIntersectsRect([container.subviews objectAtIndex:0].frame, [container.subviews objectAtIndex:1].frame));
|
||||
XCTAssertFalse(CGRectIntersectsRect([container.subviews objectAtIndex:1].frame, [container.subviews objectAtIndex:2].frame));
|
||||
XCTAssertFalse(CGRectIntersectsRect([container.subviews objectAtIndex:0].frame, [container.subviews objectAtIndex:2].frame));
|
||||
XCTAssertEqualWithAccuracy(subview2.frame.origin.x, CGRectGetMaxX(subview1.frame), FLT_EPSILON);
|
||||
XCTAssertEqualWithAccuracy(subview3.frame.origin.x, CGRectGetMaxX(subview2.frame), FLT_EPSILON);
|
||||
|
||||
CGFloat totalWidth = 0;
|
||||
for (UIView *view in container.subviews) {
|
||||
@@ -174,7 +196,7 @@
|
||||
[container.yoga applyLayout];
|
||||
|
||||
XCTAssertTrue(CGRectEqualToRect(subview1.frame, CGRectMake(0, 0, 100, 50)));
|
||||
XCTAssertTrue(CGRectEqualToRect(subview2.frame, CGRectMake(100, 0, 100, 50)), @"It's actually %@", NSStringFromCGRect(subview2.frame));
|
||||
XCTAssertTrue(CGRectEqualToRect(subview2.frame, CGRectMake(100, 0, 100, 50)));
|
||||
XCTAssertTrue(CGRectEqualToRect(subview3.frame, CGRectMake(200, 0, 100, 50)));
|
||||
|
||||
[container exchangeSubviewAtIndex:2 withSubviewAtIndex:0];
|
||||
@@ -213,18 +235,18 @@
|
||||
|
||||
[container.yoga applyLayout];
|
||||
|
||||
for (UIView *view in container.subviews) {
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(100, 50), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(view.bounds.size));
|
||||
for (UIView *subview in container.subviews) {
|
||||
XCTAssertEqual(subview.bounds.size.width, 100);
|
||||
}
|
||||
|
||||
subview3.yoga.isIncludedInLayout = NO;
|
||||
[container.yoga applyLayout];
|
||||
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 50), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview1.bounds.size));
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 50), subview2.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview2.bounds.size));
|
||||
XCTAssertEqual(subview1.bounds.size.width, 150);
|
||||
XCTAssertEqual(subview2.bounds.size.width, 150);
|
||||
|
||||
// We don't set the frame to zero, so, it should be set to what it was previously at.
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(100, 50), subview3.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview3.bounds.size));
|
||||
XCTAssertEqual(subview3.bounds.size.width, 100);
|
||||
}
|
||||
|
||||
- (void)testThatNumberOfChildrenIsCorrectWhenWeIgnoreSubviews
|
||||
@@ -249,11 +271,11 @@
|
||||
[container addSubview:subview3];
|
||||
|
||||
[container.yoga applyLayout];
|
||||
XCTAssertEqual(1, container.yoga.numberOfChildren);
|
||||
XCTAssertEqual(container.yoga.numberOfChildren, 1);
|
||||
|
||||
subview2.yoga.isIncludedInLayout = YES;
|
||||
[container.yoga applyLayout];
|
||||
XCTAssertEqual(2, container.yoga.numberOfChildren);
|
||||
XCTAssertEqual(container.yoga.numberOfChildren, 2);
|
||||
}
|
||||
|
||||
- (void)testThatViewNotIncludedInFirstLayoutPassAreIncludedInSecond
|
||||
@@ -280,18 +302,19 @@
|
||||
|
||||
[container.yoga applyLayout];
|
||||
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 50), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview1.bounds.size));
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 50), subview2.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview2.bounds.size));
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeZero, subview3.bounds.size), @"Actual size %@", NSStringFromCGSize(subview3.bounds.size));
|
||||
XCTAssertEqual(subview1.bounds.size.width, 150);
|
||||
XCTAssertEqual(subview2.bounds.size.width, 150);
|
||||
XCTAssertEqual(subview3.bounds.size.width, 0);
|
||||
|
||||
subview3.yoga.isIncludedInLayout = YES;
|
||||
[container.yoga applyLayout];
|
||||
for (UIView *view in container.subviews) {
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(100, 50), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(view.bounds.size));
|
||||
}
|
||||
|
||||
XCTAssertEqual(subview1.bounds.size.width, 100);
|
||||
XCTAssertEqual(subview2.bounds.size.width, 100);
|
||||
XCTAssertEqual(subview3.bounds.size.width, 100);
|
||||
}
|
||||
|
||||
- (void)testyg_isLeafFlag
|
||||
- (void)testIsLeafFlag
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
XCTAssertTrue(view.yoga.isLeaf);
|
||||
@@ -349,18 +372,22 @@
|
||||
}
|
||||
[container.yoga applyLayout];
|
||||
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(100, 25), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview1.bounds.size));
|
||||
XCTAssertEqual(subview1.bounds.size.width, 100);
|
||||
XCTAssertEqual(subview1.bounds.size.height, 25);
|
||||
for (UIView *subview in subview1.subviews) {
|
||||
const CGSize subviewSize = subview.bounds.size;
|
||||
XCTAssertFalse(CGSizeEqualToSize(CGSizeZero, subviewSize));
|
||||
XCTAssertNotEqual(subviewSize.width, 0);
|
||||
XCTAssertNotEqual(subviewSize.height, 0);
|
||||
XCTAssertFalse(isnan(subviewSize.height));
|
||||
XCTAssertFalse(isnan(subviewSize.width));
|
||||
}
|
||||
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 25), subview2.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview2.bounds.size));
|
||||
XCTAssertEqual(subview2.bounds.size.width, 150);
|
||||
XCTAssertEqual(subview2.bounds.size.height, 25);
|
||||
for (UIView *subview in subview2.subviews) {
|
||||
const CGSize subviewSize = subview.bounds.size;
|
||||
XCTAssertFalse(CGSizeEqualToSize(CGSizeZero, subview.bounds.size));
|
||||
XCTAssertNotEqual(subviewSize.width, 0);
|
||||
XCTAssertNotEqual(subviewSize.height, 0);
|
||||
XCTAssertFalse(isnan(subviewSize.height));
|
||||
XCTAssertFalse(isnan(subviewSize.width));
|
||||
}
|
||||
@@ -384,4 +411,211 @@
|
||||
[container.yoga applyLayout];
|
||||
}
|
||||
|
||||
- (void)testPositionalPropertiesWork
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
|
||||
view.yoga.left = 1;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeLeft).value, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.left, 1);
|
||||
|
||||
view.yoga.right = 2;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeRight).value, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.right, 2);
|
||||
|
||||
view.yoga.top = 3;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeTop).value, 3);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.top, 3);
|
||||
|
||||
view.yoga.bottom = 4;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeBottom).value, 4);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.bottom, 4);
|
||||
|
||||
view.yoga.start = 5;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeStart).value, 5);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.start, 5);
|
||||
|
||||
view.yoga.end = 6;
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeEnd).value, 6);
|
||||
XCTAssertEqual(YGNodeStyleGetPosition(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.end, 6);
|
||||
}
|
||||
|
||||
- (void)testMarginPropertiesWork
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
|
||||
view.yoga.margin = 1;
|
||||
XCTAssertEqual(view.yoga.marginLeft, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginRight, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginStart, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginEnd, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginTop, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginBottom, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.marginHorizontal));
|
||||
XCTAssertTrue(isnan(view.yoga.marginVertical));
|
||||
XCTAssertTrue(isnan(view.yoga.margin));
|
||||
|
||||
view.yoga.marginHorizontal = 2;
|
||||
XCTAssertEqual(view.yoga.marginLeft, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginRight, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginStart, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginEnd, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.marginHorizontal));
|
||||
|
||||
view.yoga.marginVertical = 3;
|
||||
XCTAssertEqual(view.yoga.marginTop, 3);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginBottom, 3);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.marginVertical));
|
||||
|
||||
view.yoga.marginLeft = 4;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).value, 4);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginLeft, 4);
|
||||
|
||||
view.yoga.marginRight = 5;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).value, 5);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginRight, 5);
|
||||
|
||||
view.yoga.marginTop = 6;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).value, 6);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginTop, 6);
|
||||
|
||||
view.yoga.marginBottom = 7;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).value, 7);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginBottom, 7);
|
||||
|
||||
view.yoga.marginStart = 8;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).value, 8);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginStart, 8);
|
||||
|
||||
view.yoga.marginEnd = 9;
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).value, 9);
|
||||
XCTAssertEqual(YGNodeStyleGetMargin(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.marginEnd, 9);
|
||||
}
|
||||
|
||||
- (void)testPaddingPropertiesWork
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
|
||||
view.yoga.padding = 1;
|
||||
XCTAssertEqual(view.yoga.paddingLeft, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingRight, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingStart, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingEnd, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingTop, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingBottom, 1);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.paddingHorizontal));
|
||||
XCTAssertTrue(isnan(view.yoga.paddingVertical));
|
||||
XCTAssertTrue(isnan(view.yoga.padding));
|
||||
|
||||
view.yoga.paddingHorizontal = 2;
|
||||
XCTAssertEqual(view.yoga.paddingLeft, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingRight, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingStart, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingEnd, 2);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.paddingHorizontal));
|
||||
|
||||
view.yoga.paddingVertical = 3;
|
||||
XCTAssertEqual(view.yoga.paddingTop, 3);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingBottom, 3);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertTrue(isnan(view.yoga.paddingVertical));
|
||||
|
||||
view.yoga.paddingLeft = 4;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).value, 4);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeLeft).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingLeft, 4);
|
||||
|
||||
view.yoga.paddingRight = 5;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).value, 5);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeRight).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingRight, 5);
|
||||
|
||||
view.yoga.paddingTop = 6;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).value, 6);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeTop).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingTop, 6);
|
||||
|
||||
view.yoga.paddingBottom = 7;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).value, 7);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeBottom).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingBottom, 7);
|
||||
|
||||
view.yoga.paddingStart = 8;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).value, 8);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeStart).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingStart, 8);
|
||||
|
||||
view.yoga.paddingEnd = 9;
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).value, 9);
|
||||
XCTAssertEqual(YGNodeStyleGetPadding(view.yoga.node, YGEdgeEnd).unit, YGUnitPixel);
|
||||
XCTAssertEqual(view.yoga.paddingEnd, 9);
|
||||
}
|
||||
|
||||
- (void)testBorderWidthPropertiesWork
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
|
||||
view.yoga.borderWidth = 1;
|
||||
XCTAssertEqual(view.yoga.borderLeftWidth, 1);
|
||||
XCTAssertEqual(view.yoga.borderRightWidth, 1);
|
||||
XCTAssertEqual(view.yoga.borderStartWidth, 1);
|
||||
XCTAssertEqual(view.yoga.borderEndWidth, 1);
|
||||
XCTAssertEqual(view.yoga.borderTopWidth, 1);
|
||||
XCTAssertEqual(view.yoga.borderBottomWidth, 1);
|
||||
XCTAssertTrue(isnan(view.yoga.borderWidth));
|
||||
|
||||
view.yoga.borderLeftWidth = 2;
|
||||
XCTAssertEqual(view.yoga.borderLeftWidth, 2);
|
||||
|
||||
view.yoga.borderRightWidth = 3;
|
||||
XCTAssertEqual(view.yoga.borderRightWidth, 3);
|
||||
|
||||
view.yoga.borderTopWidth = 4;
|
||||
XCTAssertEqual(view.yoga.borderTopWidth, 4);
|
||||
|
||||
view.yoga.borderBottomWidth = 5;
|
||||
XCTAssertEqual(view.yoga.borderBottomWidth, 5);
|
||||
|
||||
view.yoga.borderStartWidth = 6;
|
||||
XCTAssertEqual(view.yoga.borderStartWidth, 6);
|
||||
|
||||
view.yoga.borderEndWidth = 7;
|
||||
XCTAssertEqual(view.yoga.borderEndWidth, 7);
|
||||
}
|
||||
|
||||
@end
|
||||
|
5
YogaKit/YogaKitSample/Podfile
Normal file
@@ -0,0 +1,5 @@
|
||||
use_frameworks!
|
||||
|
||||
target 'YogaKitSample' do
|
||||
pod 'YogaKit', :path => '../../YogaKit.podspec'
|
||||
end
|
19
YogaKit/YogaKitSample/Podfile.lock
Normal file
@@ -0,0 +1,19 @@
|
||||
PODS:
|
||||
- Yoga (1.0.2)
|
||||
- YogaKit (1.0.3):
|
||||
- Yoga (~> 1.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- YogaKit (from `../../YogaKit.podspec`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
YogaKit:
|
||||
:path: "../../YogaKit.podspec"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Yoga: ef42f88b9bcbd7daf7267c0f19d8636ce3a50618
|
||||
YogaKit: 6d9826a015c029b13731a33bf96fe6c1e33748a6
|
||||
|
||||
PODFILE CHECKSUM: 9db3bdea7f1b4b715ad859a449b2dc87fb6226cc
|
||||
|
||||
COCOAPODS: 1.2.0
|
@@ -11,20 +11,22 @@
|
||||
13687D4B1DF8748400E7C260 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13687D4A1DF8748400E7C260 /* AppDelegate.m */; };
|
||||
13687D4E1DF8748400E7C260 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13687D4D1DF8748400E7C260 /* ViewController.m */; };
|
||||
13687D531DF8748400E7C260 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13687D521DF8748400E7C260 /* Assets.xcassets */; };
|
||||
13687D781DF878C600E7C260 /* YGEnums.h in yoga */ = {isa = PBXBuildFile; fileRef = 13687D5E1DF8778F00E7C260 /* YGEnums.h */; };
|
||||
13687D791DF878C600E7C260 /* YGMacros.h in yoga */ = {isa = PBXBuildFile; fileRef = 13687D5F1DF8778F00E7C260 /* YGMacros.h */; };
|
||||
13687D7A1DF878C600E7C260 /* Yoga.h in yoga */ = {isa = PBXBuildFile; fileRef = 13687D631DF8778F00E7C260 /* Yoga.h */; };
|
||||
13687D7C1DF878DD00E7C260 /* UIView+Yoga.h in YogaKit */ = {isa = PBXBuildFile; fileRef = 13687D691DF8778F00E7C260 /* UIView+Yoga.h */; };
|
||||
13687D801DF87CEC00E7C260 /* UIView+Yoga.m in Sources */ = {isa = PBXBuildFile; fileRef = 13687D6A1DF8778F00E7C260 /* UIView+Yoga.m */; };
|
||||
13687D811DF87CF200E7C260 /* YGNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 13687D601DF8778F00E7C260 /* YGNodeList.c */; };
|
||||
13687D821DF87CF200E7C260 /* Yoga.c in Sources */ = {isa = PBXBuildFile; fileRef = 13687D621DF8778F00E7C260 /* Yoga.c */; };
|
||||
13687D851DF87D1E00E7C260 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13687D841DF87D1E00E7C260 /* UIKit.framework */; };
|
||||
13687D871DF87D2400E7C260 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13687D861DF87D2400E7C260 /* Foundation.framework */; };
|
||||
638A94431E1EF5D000A726AD /* YGLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 638A94411E1EF5D000A726AD /* YGLayout.m */; };
|
||||
638A94451E1EF8A900A726AD /* YGValue.h in yoga */ = {isa = PBXBuildFile; fileRef = 638A94441E1EF89C00A726AD /* YGValue.h */; };
|
||||
15A7CB5995C9DAB1C8803834 /* Pods_YogaKitSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */; };
|
||||
638A94481E1F06D100A726AD /* SwiftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 638A94471E1F06D100A726AD /* SwiftViewController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
638A94541E215CC800A726AD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 13687D3B1DF8748300E7C260 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 13687D421DF8748300E7C260;
|
||||
remoteInfo = YogaKitSample;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
13687D771DF878A000E7C260 /* yoga */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
@@ -32,10 +34,6 @@
|
||||
dstPath = include/yoga;
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
638A94451E1EF8A900A726AD /* YGValue.h in yoga */,
|
||||
13687D781DF878C600E7C260 /* YGEnums.h in yoga */,
|
||||
13687D791DF878C600E7C260 /* YGMacros.h in yoga */,
|
||||
13687D7A1DF878C600E7C260 /* Yoga.h in yoga */,
|
||||
);
|
||||
name = yoga;
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -46,7 +44,6 @@
|
||||
dstPath = include/YogaKit;
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
13687D7C1DF878DD00E7C260 /* UIView+Yoga.h in YogaKit */,
|
||||
);
|
||||
name = YogaKit;
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -62,22 +59,13 @@
|
||||
13687D4D1DF8748400E7C260 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
13687D521DF8748400E7C260 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
13687D571DF8748400E7C260 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
13687D5E1DF8778F00E7C260 /* YGEnums.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGEnums.h; sourceTree = "<group>"; };
|
||||
13687D5F1DF8778F00E7C260 /* YGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGMacros.h; sourceTree = "<group>"; };
|
||||
13687D601DF8778F00E7C260 /* YGNodeList.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = YGNodeList.c; sourceTree = "<group>"; };
|
||||
13687D611DF8778F00E7C260 /* YGNodeList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGNodeList.h; sourceTree = "<group>"; };
|
||||
13687D621DF8778F00E7C260 /* Yoga.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = Yoga.c; sourceTree = "<group>"; };
|
||||
13687D631DF8778F00E7C260 /* Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Yoga.h; sourceTree = "<group>"; };
|
||||
13687D691DF8778F00E7C260 /* UIView+Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Yoga.h"; sourceTree = "<group>"; };
|
||||
13687D6A1DF8778F00E7C260 /* UIView+Yoga.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+Yoga.m"; sourceTree = "<group>"; };
|
||||
13687D841DF87D1E00E7C260 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
13687D861DF87D2400E7C260 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
638A94401E1EF5D000A726AD /* YGLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGLayout.h; sourceTree = "<group>"; };
|
||||
638A94411E1EF5D000A726AD /* YGLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YGLayout.m; sourceTree = "<group>"; };
|
||||
638A94421E1EF5D000A726AD /* YGLayout+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YGLayout+Private.h"; sourceTree = "<group>"; };
|
||||
638A94441E1EF89C00A726AD /* YGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGValue.h; sourceTree = "<group>"; };
|
||||
638A94461E1F06D100A726AD /* YogaKitSample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YogaKitSample-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
1D2FF4D5FCA6A8C54A4074A3 /* Pods-YogaKitSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
638A94471E1F06D100A726AD /* SwiftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftViewController.swift; sourceTree = "<group>"; };
|
||||
638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YogaKitSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitSample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -87,6 +75,14 @@
|
||||
files = (
|
||||
13687D871DF87D2400E7C260 /* Foundation.framework in Frameworks */,
|
||||
13687D851DF87D1E00E7C260 /* UIKit.framework in Frameworks */,
|
||||
15A7CB5995C9DAB1C8803834 /* Pods_YogaKitSample.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
638A944C1E215CC800A726AD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -96,11 +92,10 @@
|
||||
13687D3A1DF8748300E7C260 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13687D5D1DF8778F00E7C260 /* yoga */,
|
||||
13687D641DF8778F00E7C260 /* YogaKit */,
|
||||
13687D451DF8748400E7C260 /* YogaKitSample */,
|
||||
13687D441DF8748400E7C260 /* Products */,
|
||||
13687D831DF87D1E00E7C260 /* Frameworks */,
|
||||
E1C759E3C8E84821213ECE8D /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -108,6 +103,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13687D431DF8748400E7C260 /* YogaKitSample.app */,
|
||||
638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -120,7 +116,6 @@
|
||||
13687D4C1DF8748400E7C260 /* ViewController.h */,
|
||||
13687D4D1DF8748400E7C260 /* ViewController.m */,
|
||||
638A94471E1F06D100A726AD /* SwiftViewController.swift */,
|
||||
638A94461E1F06D100A726AD /* YogaKitSample-Bridging-Header.h */,
|
||||
13687D521DF8748400E7C260 /* Assets.xcassets */,
|
||||
13687D571DF8748400E7C260 /* Info.plist */,
|
||||
13687D461DF8748400E7C260 /* Supporting Files */,
|
||||
@@ -136,43 +131,25 @@
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
13687D5D1DF8778F00E7C260 /* yoga */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
638A94441E1EF89C00A726AD /* YGValue.h */,
|
||||
13687D5E1DF8778F00E7C260 /* YGEnums.h */,
|
||||
13687D5F1DF8778F00E7C260 /* YGMacros.h */,
|
||||
13687D601DF8778F00E7C260 /* YGNodeList.c */,
|
||||
13687D611DF8778F00E7C260 /* YGNodeList.h */,
|
||||
13687D621DF8778F00E7C260 /* Yoga.c */,
|
||||
13687D631DF8778F00E7C260 /* Yoga.h */,
|
||||
);
|
||||
name = yoga;
|
||||
path = ../../yoga;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
13687D641DF8778F00E7C260 /* YogaKit */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13687D691DF8778F00E7C260 /* UIView+Yoga.h */,
|
||||
13687D6A1DF8778F00E7C260 /* UIView+Yoga.m */,
|
||||
638A94401E1EF5D000A726AD /* YGLayout.h */,
|
||||
638A94421E1EF5D000A726AD /* YGLayout+Private.h */,
|
||||
638A94411E1EF5D000A726AD /* YGLayout.m */,
|
||||
);
|
||||
name = YogaKit;
|
||||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
13687D831DF87D1E00E7C260 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13687D861DF87D2400E7C260 /* Foundation.framework */,
|
||||
13687D841DF87D1E00E7C260 /* UIKit.framework */,
|
||||
C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E1C759E3C8E84821213ECE8D /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D2FF4D5FCA6A8C54A4074A3 /* Pods-YogaKitSample.debug.xcconfig */,
|
||||
82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -180,11 +157,14 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 13687D5A1DF8748400E7C260 /* Build configuration list for PBXNativeTarget "YogaKitSample" */;
|
||||
buildPhases = (
|
||||
513B543F92B2E4F4D1EE1CE7 /* [CP] Check Pods Manifest.lock */,
|
||||
13687D771DF878A000E7C260 /* yoga */,
|
||||
13687D7B1DF878CE00E7C260 /* YogaKit */,
|
||||
13687D3F1DF8748300E7C260 /* Sources */,
|
||||
13687D401DF8748300E7C260 /* Frameworks */,
|
||||
13687D411DF8748300E7C260 /* Resources */,
|
||||
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */,
|
||||
6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -195,6 +175,24 @@
|
||||
productReference = 13687D431DF8748400E7C260 /* YogaKitSample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
638A944E1E215CC800A726AD /* YogaKitSampleTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 638A94561E215CC800A726AD /* Build configuration list for PBXNativeTarget "YogaKitSampleTests" */;
|
||||
buildPhases = (
|
||||
638A944B1E215CC800A726AD /* Sources */,
|
||||
638A944C1E215CC800A726AD /* Frameworks */,
|
||||
638A944D1E215CC800A726AD /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
638A94551E215CC800A726AD /* PBXTargetDependency */,
|
||||
);
|
||||
name = YogaKitSampleTests;
|
||||
productName = YogaKitSampleTests;
|
||||
productReference = 638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@@ -209,6 +207,11 @@
|
||||
LastSwiftMigration = 0820;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
638A944E1E215CC800A726AD = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 13687D421DF8748300E7C260;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 13687D3E1DF8748300E7C260 /* Build configuration list for PBXProject "YogaKitSample" */;
|
||||
@@ -225,6 +228,7 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
13687D421DF8748300E7C260 /* YogaKitSample */,
|
||||
638A944E1E215CC800A726AD /* YogaKitSampleTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -238,26 +242,92 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
638A944D1E215CC800A726AD /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
513B543F92B2E4F4D1EE1CE7 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
13687D3F1DF8748300E7C260 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
638A94481E1F06D100A726AD /* SwiftViewController.swift in Sources */,
|
||||
13687D801DF87CEC00E7C260 /* UIView+Yoga.m in Sources */,
|
||||
13687D4E1DF8748400E7C260 /* ViewController.m in Sources */,
|
||||
13687D4B1DF8748400E7C260 /* AppDelegate.m in Sources */,
|
||||
13687D821DF87CF200E7C260 /* Yoga.c in Sources */,
|
||||
13687D811DF87CF200E7C260 /* YGNodeList.c in Sources */,
|
||||
13687D481DF8748400E7C260 /* main.m in Sources */,
|
||||
638A94431E1EF5D000A726AD /* YGLayout.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
638A944B1E215CC800A726AD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
638A94551E215CC800A726AD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 13687D421DF8748300E7C260 /* YogaKitSample */;
|
||||
targetProxy = 638A94541E215CC800A726AD /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
13687D581DF8748400E7C260 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
@@ -351,6 +421,7 @@
|
||||
};
|
||||
13687D5B1DF8748400E7C260 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 1D2FF4D5FCA6A8C54A4074A3 /* Pods-YogaKitSample.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -358,7 +429,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "YogaKitSample/YogaKitSample-Bridging-Header.h";
|
||||
SWIFT_INSTALL_OBJC_HEADER = NO;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
@@ -366,6 +437,7 @@
|
||||
};
|
||||
13687D5C1DF8748400E7C260 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -373,11 +445,39 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "YogaKitSample/YogaKitSample-Bridging-Header.h";
|
||||
SWIFT_INSTALL_OBJC_HEADER = NO;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
638A94571E215CC800A726AD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YogaKitSample.app/YogaKitSample";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
638A94581E215CC800A726AD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = YogaKitSampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YogaKitSample.app/YogaKitSample";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
@@ -399,6 +499,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
638A94561E215CC800A726AD /* Build configuration list for PBXNativeTarget "YogaKitSampleTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
638A94571E215CC800A726AD /* Debug */,
|
||||
638A94581E215CC800A726AD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 13687D3B1DF8748300E7C260 /* Project object */;
|
||||
|
10
YogaKit/YogaKitSample/YogaKitSample.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:YogaKitSample.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
@@ -13,4 +13,3 @@
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -1,43 +1,69 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"filename" : "Yoga-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"filename" : "Yoga-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"filename" : "Yoga-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-57x57@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-57x57@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Yoga-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 868 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 7.4 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import UIKit
|
||||
import YogaKit
|
||||
|
||||
class SwiftViewController: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
|
@@ -10,6 +10,4 @@
|
||||
|
||||
@interface ViewController : UIViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
1
csharp/Android/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
lib/
|
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2021459E-8FB1-44A4-89F1-E291769CD2C6}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.Android.Tests</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.Android.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="Xamarin.Android.NUnitLite" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Facebook.Yoga.Android\Facebook.Yoga.Android.csproj">
|
||||
<Project>{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}</Project>
|
||||
<Name>Facebook.Yoga.Android</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems" Label="Shared" Condition="Exists('..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
25
csharp/Android/Facebook.Yoga.Android.Tests/MainActivity.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE-examples file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using Android.App;
|
||||
using Android.OS;
|
||||
using Xamarin.Android.NUnitLite;
|
||||
|
||||
namespace Facebook.Yoga.Android.Tests
|
||||
{
|
||||
[Activity(Label = "Facebook.Yoga.Android.Tests", MainLauncher = true)]
|
||||
public class MainActivity : TestSuiteActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
AddTest(Assembly.GetExecutingAssembly());
|
||||
base.OnCreate(bundle);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
package="Facebook.Yoga.Android.Tests">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19" />
|
||||
|
||||
<application
|
||||
android:label="Facebook.Yoga.Android.Tests">
|
||||
</application>
|
||||
|
||||
</manifest>
|
0
csharp/Android/Facebook.Yoga.Android.Tests/Resources/Resource.designer.cs
generated
Normal file
33
csharp/Android/Facebook.Yoga.Android.sln
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android.Tests", "Facebook.Yoga.Android.Tests\Facebook.Yoga.Android.Tests.csproj", "{2021459E-8FB1-44A4-89F1-E291769CD2C6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Android", "Facebook.Yoga.Android\Facebook.Yoga.Android.csproj", "{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2021459E-8FB1-44A4-89F1-E291769CD2C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{91C42D32-291D-4B72-90B4-551663D60B8B} = {4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}
|
||||
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {4804A8E6-E7B7-4F9E-A446-3DE8E73DB38A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildDependsOn>NativeLibraryARMV7;NativeLibraryX86;$(BuildDependsOn)</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="NativeLibraryARMV7" Outputs="$(ProjectDir)/lib/armeabi-v7a/libyoga.so">
|
||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-armv7,shared" />
|
||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-armv7,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/armeabi-v7a/libyoga.so" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
<!--
|
||||
<Target Name="NativeLibraryARM64" Outputs="$(ProjectDir)/lib/arm64-v8a/libyoga.so">
|
||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-arm64,shared" />
|
||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-arm64,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/arm64-v8/libyoga.so" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
-->
|
||||
<Target Name="NativeLibraryX86" Outputs="$(ProjectDir)/lib/x86/libyoga.so">
|
||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet#android-x86,shared" />
|
||||
<Copy SourceFiles="$(ProjectDir)../../../buck-out/gen/csharp/yoganet#android-x86,shared/libyoga.so" DestinationFiles="$(ProjectDir)/lib/x86/libyoga.so" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EDF7CF8B-5640-4E1D-A2C7-E4BC8BE44363}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.Android</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.Android</AssemblyName>
|
||||
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<AndroidSupportedAbis>arm64-v8a;armeabi;armeabi-v7a;x86</AndroidSupportedAbis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CustomBuildAction.targets" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="lib\x86\" />
|
||||
<Folder Include="lib\armeabi-v7a\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedNativeLibrary Include="lib\x86\libyoga.so">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedNativeLibrary>
|
||||
<EmbeddedNativeLibrary Include="lib\armeabi-v7a\libyoga.so">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedNativeLibrary>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems" Label="Shared" Condition="Exists('..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="CustomBuildAction.targets" />
|
||||
</Project>
|
0
csharp/Android/Facebook.Yoga.Android/Resources/Resource.designer.cs
generated
Normal file
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[System.Obsolete]
|
||||
public class Border
|
||||
{
|
||||
public float? Top;
|
||||
public float? Bottom;
|
||||
public float? Left;
|
||||
public float? Right;
|
||||
|
||||
public Border(
|
||||
float? top = null,
|
||||
float? bottom = null,
|
||||
float? left = null,
|
||||
float? right = null)
|
||||
{
|
||||
Top = top;
|
||||
Bottom = bottom;
|
||||
Left = left;
|
||||
Right = right;
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,11 +10,9 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BaselineFunction.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Border.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)MeasureFunction.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)MeasureOutput.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Native.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Spacing.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaAlign.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaBaselineFunc.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaConstants.cs" />
|
||||
@@ -28,7 +26,6 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaLogLevel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaMeasureFunc.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaMeasureMode.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaNode.Create.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaNode.Spacing.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaNode.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaOverflow.cs" />
|
||||
|
@@ -89,10 +89,6 @@ namespace Facebook.Yoga
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void YGNodePrint(YGNodeHandle node, YogaPrintOptions options);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool YGValueIsUndefined(float value);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void YGNodeCopyStyle(YGNodeHandle dstNode, YGNodeHandle srcNode);
|
||||
|
||||
@@ -173,6 +169,12 @@ namespace Facebook.Yoga
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern YogaOverflow YGNodeStyleGetOverflow(YGNodeHandle node);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void YGNodeStyleSetDisplay(YGNodeHandle node, YogaDisplay display);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern YogaDisplay YGNodeStyleGetDisplay(YGNodeHandle node);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void YGNodeStyleSetFlex(YGNodeHandle node, float flex);
|
||||
|
||||
@@ -316,6 +318,9 @@ namespace Facebook.Yoga
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float YGNodeLayoutGetHeight(YGNodeHandle node);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float YGNodeLayoutGetMargin(YGNodeHandle node, YogaEdge edge);
|
||||
|
||||
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float YGNodeLayoutGetPadding(YGNodeHandle node, YogaEdge edge);
|
||||
|
||||
|
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[System.Obsolete]
|
||||
public class Spacing
|
||||
{
|
||||
public YogaValue? Top;
|
||||
public YogaValue? Bottom;
|
||||
public YogaValue? Left;
|
||||
public YogaValue? Right;
|
||||
|
||||
public Spacing(
|
||||
YogaValue? top = null,
|
||||
YogaValue? bottom = null,
|
||||
YogaValue? left = null,
|
||||
YogaValue? right = null)
|
||||
{
|
||||
Top = top;
|
||||
Bottom = bottom;
|
||||
Left = left;
|
||||
Right = right;
|
||||
}
|
||||
}
|
||||
}
|
17
csharp/Facebook.Yoga/YogaDisplay.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
public enum YogaDisplay
|
||||
{
|
||||
Flex,
|
||||
None,
|
||||
}
|
||||
}
|
@@ -1,234 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
public partial class YogaNode
|
||||
{
|
||||
[Obsolete("use Object Initializer")]
|
||||
public static YogaNode Create(
|
||||
YogaDirection? styleDirection = null,
|
||||
YogaFlexDirection? flexDirection = null,
|
||||
YogaJustify? justifyContent = null,
|
||||
YogaAlign? alignContent = null,
|
||||
YogaAlign? alignItems = null,
|
||||
YogaAlign? alignSelf = null,
|
||||
YogaPositionType? positionType = null,
|
||||
YogaWrap? wrap = null,
|
||||
YogaOverflow? overflow = null,
|
||||
float? flex = null,
|
||||
float? flexGrow = null,
|
||||
float? flexShrink = null,
|
||||
YogaValue? flexBasis = null,
|
||||
Spacing position = null,
|
||||
Spacing margin = null,
|
||||
Spacing padding = null,
|
||||
Border border = null,
|
||||
YogaValue? width = null,
|
||||
YogaValue? height = null,
|
||||
YogaValue? maxWidth = null,
|
||||
YogaValue? maxHeight = null,
|
||||
YogaValue? minWidth = null,
|
||||
YogaValue? minHeight = null)
|
||||
{
|
||||
YogaNode node = new YogaNode();
|
||||
|
||||
if (styleDirection.HasValue)
|
||||
{
|
||||
node.StyleDirection = styleDirection.Value;
|
||||
}
|
||||
|
||||
if (flexDirection.HasValue)
|
||||
{
|
||||
node.FlexDirection = flexDirection.Value;
|
||||
}
|
||||
|
||||
if (justifyContent.HasValue)
|
||||
{
|
||||
node.JustifyContent = justifyContent.Value;
|
||||
}
|
||||
|
||||
if (alignContent.HasValue)
|
||||
{
|
||||
node.AlignContent = alignContent.Value;
|
||||
}
|
||||
|
||||
if (alignItems.HasValue)
|
||||
{
|
||||
node.AlignItems = alignItems.Value;
|
||||
}
|
||||
|
||||
if (alignSelf.HasValue)
|
||||
{
|
||||
node.AlignSelf = alignSelf.Value;
|
||||
}
|
||||
|
||||
if (positionType.HasValue)
|
||||
{
|
||||
node.PositionType = positionType.Value;
|
||||
}
|
||||
|
||||
if (wrap.HasValue)
|
||||
{
|
||||
node.Wrap = wrap.Value;
|
||||
}
|
||||
|
||||
if (overflow.HasValue)
|
||||
{
|
||||
node.Overflow = overflow.Value;
|
||||
}
|
||||
|
||||
if (flex.HasValue)
|
||||
{
|
||||
node.Flex = flex.Value;
|
||||
}
|
||||
|
||||
if (flexGrow.HasValue)
|
||||
{
|
||||
node.FlexGrow = flexGrow.Value;
|
||||
}
|
||||
|
||||
if (flexShrink.HasValue)
|
||||
{
|
||||
node.FlexShrink = flexShrink.Value;
|
||||
}
|
||||
|
||||
if (flexBasis.HasValue)
|
||||
{
|
||||
node.FlexBasis = flexBasis.Value;
|
||||
}
|
||||
|
||||
if (position != null)
|
||||
{
|
||||
if (position.Top.HasValue)
|
||||
{
|
||||
node.Top = position.Top.Value;
|
||||
}
|
||||
|
||||
if (position.Bottom.HasValue)
|
||||
{
|
||||
node.Bottom = position.Bottom.Value;
|
||||
}
|
||||
|
||||
if (position.Left.HasValue)
|
||||
{
|
||||
node.Left = position.Left.Value;
|
||||
}
|
||||
|
||||
if (position.Right.HasValue)
|
||||
{
|
||||
node.Right = position.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (margin != null)
|
||||
{
|
||||
if (margin.Top.HasValue)
|
||||
{
|
||||
node.MarginTop = margin.Top.Value;
|
||||
}
|
||||
|
||||
if (margin.Bottom.HasValue)
|
||||
{
|
||||
node.MarginBottom = margin.Bottom.Value;
|
||||
}
|
||||
|
||||
if (margin.Left.HasValue)
|
||||
{
|
||||
node.MarginLeft = margin.Left.Value;
|
||||
}
|
||||
|
||||
if (margin.Right.HasValue)
|
||||
{
|
||||
node.MarginRight = margin.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (padding != null)
|
||||
{
|
||||
if (padding.Top.HasValue)
|
||||
{
|
||||
node.PaddingTop = padding.Top.Value;
|
||||
}
|
||||
|
||||
if (padding.Bottom.HasValue)
|
||||
{
|
||||
node.PaddingBottom = padding.Bottom.Value;
|
||||
}
|
||||
|
||||
if (padding.Left.HasValue)
|
||||
{
|
||||
node.PaddingLeft = padding.Left.Value;
|
||||
}
|
||||
|
||||
if (padding.Right.HasValue)
|
||||
{
|
||||
node.PaddingRight = padding.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (border != null)
|
||||
{
|
||||
if (border.Top.HasValue)
|
||||
{
|
||||
node.BorderTopWidth = border.Top.Value;
|
||||
}
|
||||
|
||||
if (border.Bottom.HasValue)
|
||||
{
|
||||
node.BorderBottomWidth = border.Bottom.Value;
|
||||
}
|
||||
|
||||
if (border.Left.HasValue)
|
||||
{
|
||||
node.BorderLeftWidth = border.Left.Value;
|
||||
}
|
||||
|
||||
if (border.Right.HasValue)
|
||||
{
|
||||
node.BorderRightWidth = border.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (width.HasValue)
|
||||
{
|
||||
node.Width = width.Value;
|
||||
}
|
||||
|
||||
if (height.HasValue)
|
||||
{
|
||||
node.Height = height.Value;
|
||||
}
|
||||
|
||||
if (minWidth.HasValue)
|
||||
{
|
||||
node.MinWidth = minWidth.Value;
|
||||
}
|
||||
|
||||
if (minHeight.HasValue)
|
||||
{
|
||||
node.MinHeight = minHeight.Value;
|
||||
}
|
||||
|
||||
if (maxWidth.HasValue)
|
||||
{
|
||||
node.MaxWidth = maxWidth.Value;
|
||||
}
|
||||
|
||||
if (maxHeight.HasValue)
|
||||
{
|
||||
node.MaxHeight = maxHeight.Value;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
@@ -452,6 +452,54 @@ namespace Facebook.Yoga
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Left);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginTop
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Top);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginRight
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Right);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginBottom
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Start);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutMarginEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.End);
|
||||
}
|
||||
}
|
||||
|
||||
public float LayoutPaddingLeft
|
||||
{
|
||||
get
|
||||
|
@@ -36,6 +36,12 @@ namespace Facebook.Yoga
|
||||
}
|
||||
}
|
||||
|
||||
public YogaNode(YogaNode srcNode)
|
||||
: this()
|
||||
{
|
||||
CopyStyle(srcNode);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_measureFunction = null;
|
||||
@@ -139,6 +145,19 @@ namespace Facebook.Yoga
|
||||
}
|
||||
}
|
||||
|
||||
public YogaDisplay Display
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.YGNodeStyleGetDisplay(_ygNode);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Native.YGNodeStyleSetDisplay(_ygNode, value);
|
||||
}
|
||||
}
|
||||
|
||||
public YogaAlign AlignItems
|
||||
{
|
||||
get
|
||||
@@ -258,81 +277,6 @@ namespace Facebook.Yoga
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("use Margin properties")]
|
||||
public YogaValue GetMargin(YogaEdge edge)
|
||||
{
|
||||
return Native.YGNodeStyleGetMargin(_ygNode, edge);
|
||||
}
|
||||
|
||||
[Obsolete("use Margin properties")]
|
||||
public void SetMargin(YogaEdge edge, YogaValue value)
|
||||
{
|
||||
if (value.Unit == YogaUnit.Percent)
|
||||
{
|
||||
Native.YGNodeStyleSetMarginPercent(_ygNode, edge, value.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
Native.YGNodeStyleSetMargin(_ygNode, edge, value.Value);
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("use Padding properties")]
|
||||
public YogaValue GetPadding(YogaEdge edge)
|
||||
{
|
||||
return Native.YGNodeStyleGetPadding(_ygNode, edge);
|
||||
}
|
||||
|
||||
[Obsolete("use Padding properties")]
|
||||
public void SetPadding(YogaEdge edge, YogaValue value)
|
||||
{
|
||||
if (value.Unit == YogaUnit.Percent)
|
||||
{
|
||||
Native.YGNodeStyleSetPaddingPercent(_ygNode, edge, value.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
Native.YGNodeStyleSetPadding(_ygNode, edge, value.Value);
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("use BorderWidth properties")]
|
||||
public float GetBorder(YogaEdge edge)
|
||||
{
|
||||
return Native.YGNodeStyleGetBorder(_ygNode, edge);
|
||||
}
|
||||
|
||||
[Obsolete("use BorderWidth properties")]
|
||||
public void SetBorder(YogaEdge edge, float border)
|
||||
{
|
||||
Native.YGNodeStyleSetBorder(_ygNode, edge, border);
|
||||
}
|
||||
|
||||
[Obsolete("use Position properties")]
|
||||
public YogaValue GetPosition(YogaEdge edge)
|
||||
{
|
||||
return Native.YGNodeStyleGetPosition(_ygNode, edge);
|
||||
}
|
||||
|
||||
[Obsolete("use Position properties")]
|
||||
public void SetPosition(YogaEdge edge, YogaValue value)
|
||||
{
|
||||
if (value.Unit == YogaUnit.Percent)
|
||||
{
|
||||
Native.YGNodeStyleSetPositionPercent(_ygNode, edge, value.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
Native.YGNodeStyleSetPosition(_ygNode, edge, value.Value);
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("use LayoutPadding properties")]
|
||||
public float GetLayoutPadding(YogaEdge edge)
|
||||
{
|
||||
return Native.YGNodeLayoutGetPadding(_ygNode, edge);
|
||||
}
|
||||
|
||||
public YogaValue Width
|
||||
{
|
||||
get
|
||||
|
11
csharp/Facebook.YogaKit/Facebook.YogaKit.Shared.shproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{A24B3BA6-3143-4FFF-B8B8-1EDF166F5F4A}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<Import Project="Facebook.YogaKit.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
16
csharp/Facebook.YogaKit/Facebook.YogaKit.projitems
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>{A24B3BA6-3143-4FFF-B8B8-1EDF166F5F4A}</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>Facebook.YogaKit</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaLayout.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)IYogaLayout.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)YogaKit.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
85
csharp/Facebook.YogaKit/IYogaLayout.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using Facebook.Yoga;
|
||||
|
||||
namespace Facebook.YogaKit
|
||||
{
|
||||
public interface IYogaLayout : IDisposable
|
||||
{
|
||||
bool IsEnabled { get; set; }
|
||||
bool IsIncludeInLayout { get; set; }
|
||||
|
||||
//YogaDirection Direction { get; set; }
|
||||
YogaFlexDirection FlexDirection { get; set; }
|
||||
YogaJustify JustifyContent { get; set; }
|
||||
YogaAlign AlignContent { get; set; }
|
||||
YogaAlign AlignSelf { get; set; }
|
||||
YogaAlign AlignItems { get; set; }
|
||||
YogaPositionType Position { get; set; }
|
||||
YogaWrap FlexWrap { get; set; }
|
||||
YogaOverflow Overflow { get; set; }
|
||||
|
||||
|
||||
float FlexGrow { get; set; }
|
||||
float FlexShrink { get; set; }
|
||||
float FlexBasis { get; set; }
|
||||
|
||||
float Left { get; set; }
|
||||
float Top { get; set; }
|
||||
float Right { get; set; }
|
||||
float Bottom { get; set; }
|
||||
float Start { get; set; }
|
||||
float End { get; set; }
|
||||
|
||||
float MarginLeft { get; set; }
|
||||
float MarginTop { get; set; }
|
||||
float MarginRight { get; set; }
|
||||
float MarginBottom { get; set; }
|
||||
float MarginStart { get; set; }
|
||||
float MarginEnd { get; set; }
|
||||
float MarginHorizontal { get; set; }
|
||||
float MarginVertical { get; set; }
|
||||
float Margin { get; set; }
|
||||
|
||||
float PaddingLeft { get; set; }
|
||||
float PaddingTop { get; set; }
|
||||
float PaddingRight { get; set; }
|
||||
float PaddingBottom { get; set; }
|
||||
float PaddingStart { get; set; }
|
||||
float PaddingEnd { get; set; }
|
||||
float PaddingHorizontal { get; set; }
|
||||
float PaddingVertical { get; set; }
|
||||
float Padding { get; set; }
|
||||
|
||||
float BorderLeftWidth { get; set; }
|
||||
float BorderTopWidth { get; set; }
|
||||
float BorderRightWidth { get; set; }
|
||||
float BorderBottomWidth { get; set; }
|
||||
float BorderStartWidth { get; set; }
|
||||
float BorderEndWidth { get; set; }
|
||||
float BorderWidth { get; set; }
|
||||
|
||||
float Width { get; set; }
|
||||
float Height { get; set; }
|
||||
float MinWidth { get; set; }
|
||||
float MinHeight { get; set; }
|
||||
float MaxWidth { get; set; }
|
||||
float MaxHeight { get; set; }
|
||||
|
||||
// Yoga specific properties, not compatible with flexbox specification
|
||||
|
||||
// Returns the size of the view if no constraints were given. This could equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
SizeF IntrinsicSize { get; }
|
||||
float AspectRatio { get; set; }
|
||||
// Get the resolved direction of this node. This won't be YGDirectionInherit
|
||||
YogaDirection ResolvedDirection { get; }
|
||||
// Returns the number of children that are using Flexbox.
|
||||
int NumberOfChildren { get; }
|
||||
// Return a BOOL indiciating whether or not we this node contains any subviews that are included in Yoga's layout.
|
||||
bool IsLeaf { get; }
|
||||
// Perform a layout calculation and update the frames of the views in the hierarchy with the results
|
||||
void ApplyLayout();
|
||||
// Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
||||
void MarkDirty();
|
||||
}
|
||||
}
|
10
csharp/Facebook.YogaKit/YogaKit.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using Facebook.Yoga;
|
||||
|
||||
namespace Facebook.YogaKit
|
||||
{
|
||||
public static partial class YogaKit
|
||||
{
|
||||
internal static Dictionary<YogaNode, object> Bridges = new Dictionary<YogaNode, object>();
|
||||
}
|
||||
}
|
888
csharp/Facebook.YogaKit/YogaLayout.cs
Normal file
@@ -0,0 +1,888 @@
|
||||
using System;
|
||||
using Facebook.Yoga;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
#if __IOS__
|
||||
using NativeView = UIKit.UIView;
|
||||
#endif
|
||||
|
||||
namespace Facebook.YogaKit
|
||||
{
|
||||
public partial class YogaLayout : IYogaLayout
|
||||
{
|
||||
WeakReference<NativeView> _viewRef;
|
||||
YogaNode _node;
|
||||
|
||||
internal YogaLayout(NativeView view)
|
||||
{
|
||||
_viewRef = new WeakReference<NativeView>(view);
|
||||
_node = new YogaNode();
|
||||
YogaKit.Bridges.Add(_node, view);
|
||||
|
||||
IsEnabled = false;
|
||||
IsIncludeInLayout = true;
|
||||
}
|
||||
|
||||
public new void MarkDirty()
|
||||
{
|
||||
if (IsLeaf)
|
||||
_node.MarkDirty();
|
||||
}
|
||||
|
||||
public bool IsLeaf
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsEnabled)
|
||||
{
|
||||
NativeView view = null;
|
||||
if (_viewRef.TryGetTarget(out view))
|
||||
{
|
||||
foreach (NativeView subview in GetChildren(view))
|
||||
{
|
||||
var layout = subview.Yoga();
|
||||
if (layout.IsEnabled && layout.IsIncludeInLayout)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool IsIncludeInLayout
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public int NumberOfChildren => _node.Count;
|
||||
|
||||
public YogaDirection ResolvedDirection => _node.LayoutDirection;
|
||||
|
||||
public YogaFlexDirection FlexDirection
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.FlexDirection;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.FlexDirection = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaAlign AlignItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.AlignItems;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.AlignItems = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaJustify JustifyContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.JustifyContent;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.JustifyContent = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaAlign AlignContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.AlignContent;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.AlignContent = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaAlign AlignSelf
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.AlignSelf;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.AlignSelf = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaPositionType Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PositionType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PositionType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaWrap FlexWrap
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Wrap;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Wrap = value;
|
||||
}
|
||||
}
|
||||
|
||||
public YogaOverflow Overflow
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Overflow;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Overflow = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float FlexGrow
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.FlexGrow;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.FlexGrow = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float FlexShrink
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.FlexShrink;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.FlexShrink = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float FlexBasis
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)_node.FlexBasis.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.FlexBasis = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Left
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Left.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Left = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Top
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Top.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Top = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Right
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Right.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Right = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Bottom
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Bottom.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Bottom = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Start
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Start.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Start = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float End
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.End.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.End = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginLeft.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginLeft = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginTop
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginTop.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginTop = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginRight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginRight.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginRight = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginBottom
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginBottom.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginBottom = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginStart.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginEnd.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginEnd = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginHorizontal
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginHorizontal.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginHorizontal = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MarginVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MarginVertical.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MarginVertical = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Margin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Margin.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Margin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingLeft.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingLeft = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingTop
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingTop.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingTop = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingRight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingRight.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingRight = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingBottom
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingBottom.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingBottom = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingStart.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingEnd.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingEnd = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingHorizontal
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingHorizontal.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingHorizontal = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float PaddingVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.PaddingVertical.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.PaddingHorizontal = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Padding
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Padding.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Padding = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderLeftWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderLeftWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderLeftWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderTopWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderTopWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderTopWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderRightWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderRightWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderRightWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderBottomWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderBottomWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderBottomWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderStartWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderStartWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderStartWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderEndWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderEndWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderEndWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float BorderWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.BorderWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.BorderWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Height.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Height = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.Width.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.Width = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MinWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MinWidth.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MinWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MinHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MinHeight.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MinHeight = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MaxWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MaxWidth.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MaxWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float MaxHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.MaxHeight.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.MaxHeight = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float AspectRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
return _node.StyleAspectRatio;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_node.StyleAspectRatio = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyLayout()
|
||||
{
|
||||
NativeView view = null;
|
||||
if (_viewRef.TryGetTarget(out view))
|
||||
{
|
||||
float width = 0;
|
||||
float height = 0;
|
||||
GetWidthHeightOfNativeView(view, out width, out height);
|
||||
CalculateLayoutWithSize(this, width, height);
|
||||
ApplyLayoutToViewHierarchy(view);
|
||||
}
|
||||
}
|
||||
public SizeF IntrinsicSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return CalculateLayoutWithSize(this, float.NaN, float.NaN);
|
||||
}
|
||||
}
|
||||
|
||||
SizeF CalculateLayoutWithSize(YogaLayout layout, float width, float height)
|
||||
{
|
||||
//TODO : Check thread access
|
||||
if (!layout.IsEnabled)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Doesn't use Yoga");
|
||||
}
|
||||
NativeView view = null;
|
||||
if (_viewRef.TryGetTarget(out view))
|
||||
{
|
||||
AttachNodesFromViewHierachy(view);
|
||||
}
|
||||
|
||||
var node = layout._node;
|
||||
|
||||
node.Width = width;
|
||||
node.Height = height;
|
||||
node.CalculateLayout();
|
||||
|
||||
return new SizeF { Width = node.LayoutWidth, Height = node.LayoutHeight };
|
||||
}
|
||||
|
||||
static YogaSize MeasureView(YogaNode node, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode)
|
||||
{
|
||||
var constrainedWidth = (widthMode == YogaMeasureMode.Undefined) ? float.MaxValue : width;
|
||||
var constrainedHeight = (heightMode == YogaMeasureMode.Undefined) ? float.MaxValue : height;
|
||||
|
||||
NativeView view = null;
|
||||
if (YogaKit.Bridges.ContainsKey(node))
|
||||
view = YogaKit.Bridges[node] as NativeView;
|
||||
|
||||
float sizeThatFitsWidth = 0;
|
||||
float sizeThatFitsHeight = 0;
|
||||
|
||||
MeasureNativeView(view, constrainedWidth, constrainedHeight, out sizeThatFitsWidth, out sizeThatFitsHeight);
|
||||
|
||||
var finalWidth = SanitizeMeasurement(constrainedWidth, sizeThatFitsWidth, widthMode);
|
||||
var finalHeight = SanitizeMeasurement(constrainedHeight, sizeThatFitsHeight, heightMode);
|
||||
|
||||
return MeasureOutput.Make(finalWidth, finalHeight);
|
||||
}
|
||||
|
||||
static float SanitizeMeasurement(float constrainedSize, float measuredSize, YogaMeasureMode measureMode)
|
||||
{
|
||||
float result;
|
||||
if (measureMode == YogaMeasureMode.Exactly)
|
||||
{
|
||||
result = (float)constrainedSize;
|
||||
}
|
||||
else if (measureMode == YogaMeasureMode.AtMost)
|
||||
{
|
||||
result = (float)Math.Min(constrainedSize, measuredSize);
|
||||
}
|
||||
else {
|
||||
result = (float)measuredSize;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool NodeHasExactSameChildren(YogaNode node, NativeView[] subviews)
|
||||
{
|
||||
if (node.Count != subviews.Length)
|
||||
return false;
|
||||
for (int i = 0; i < subviews.Length; i++)
|
||||
{
|
||||
YogaLayout yoga = subviews[i].Yoga() as YogaLayout;
|
||||
if (node[i] != yoga._node)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void AttachNodesFromViewHierachy(NativeView view)
|
||||
{
|
||||
YogaLayout yoga = view.Yoga() as YogaLayout;
|
||||
var node = yoga._node;
|
||||
// Only leaf nodes should have a measure function
|
||||
if (yoga.IsLeaf)
|
||||
{
|
||||
RemoveAllChildren(node);
|
||||
node.SetMeasureFunction(MeasureView);
|
||||
}
|
||||
else
|
||||
{
|
||||
node.SetMeasureFunction(null);
|
||||
// Create a list of all the subviews that we are going to use for layout.
|
||||
var subviewsToInclude = new List<NativeView>();
|
||||
foreach (var subview in view.Subviews)
|
||||
{
|
||||
if (subview.Yoga().IsIncludeInLayout)
|
||||
{
|
||||
subviewsToInclude.Add(subview);
|
||||
}
|
||||
}
|
||||
|
||||
if (!NodeHasExactSameChildren(node, subviewsToInclude.ToArray()))
|
||||
{
|
||||
RemoveAllChildren(node);
|
||||
for (int i = 0; i < subviewsToInclude.Count; i++)
|
||||
{
|
||||
YogaLayout yogaSubview = subviewsToInclude[i].Yoga() as YogaLayout;
|
||||
node.Insert(i, yogaSubview._node);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var subView in subviewsToInclude)
|
||||
{
|
||||
AttachNodesFromViewHierachy(subView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void RemoveAllChildren(YogaNode node)
|
||||
{
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
if (node.Count > 0)
|
||||
{
|
||||
node.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
static double RoundPixelValue(float value)
|
||||
{
|
||||
float scale = NativePixelScale;
|
||||
|
||||
return Math.Round(value * scale) / scale;
|
||||
}
|
||||
|
||||
static void ApplyLayoutToViewHierarchy(NativeView view)
|
||||
{
|
||||
//TODO : "Framesetting should only be done on the main thread."
|
||||
YogaLayout yoga = view.Yoga() as YogaLayout;
|
||||
|
||||
if (!yoga.IsIncludeInLayout)
|
||||
return;
|
||||
|
||||
var node = yoga._node;
|
||||
|
||||
ApplyLayoutToNativeView(view, node);
|
||||
|
||||
if (!yoga.IsLeaf)
|
||||
{
|
||||
for (int i = 0; i < view.Subviews.Length; i++)
|
||||
{
|
||||
ApplyLayoutToViewHierarchy(view.Subviews[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<CompileDependsOn>CopyInNativeLib;$(CompileDependsOn)</CompileDependsOn>
|
||||
<CompileDependsOn>NativeLibrary;$(CompileDependsOn)</CompileDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- The # and , in this path does not play nice with the binding project logic, so make a copy -->
|
||||
<Target Name="CopyInNativeLib" Inputs="..\..\buck-out\gen\csharp\yoganet#default,shared\libyoga.dylib" Outputs="$(ProjectDir)libyoga.dylib">
|
||||
<Copy SourceFiles="..\..\buck-out\gen\csharp\yoganet#default,shared\libyoga.dylib" DestinationFiles="$(ProjectDir)/libyoga.dylib" />
|
||||
<Target Name="NativeLibrary" Outputs="$(ProjectDir)libyoga.dylib">
|
||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)buck-build.sh //csharp:yoganet#default,shared" />
|
||||
<Copy SourceFiles="$(ProjectDir)..\..\buck-out\gen\csharp\yoganet#default,shared\libyoga.dylib" DestinationFiles="$(ProjectDir)libyoga.dylib" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
using AppKit;
|
||||
using Foundation;
|
||||
|
||||
namespace Facebook.Yoga.Mac.Test
|
||||
namespace Facebook.Yoga.Mac.Sample
|
||||
{
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : NSApplicationDelegate
|
@@ -6,8 +6,8 @@
|
||||
<ProjectGuid>{64E0AB97-A904-4607-A535-EEA5A966C09E}</ProjectGuid>
|
||||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.Mac.Test</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.Mac.Test</AssemblyName>
|
||||
<RootNamespace>Facebook.Yoga.Mac.Sample</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.Mac.Sample</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
|
||||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
|
@@ -3,9 +3,9 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Facebook.Yoga.Mac.Test</string>
|
||||
<string>Facebook.Yoga.Mac.Sample</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.facebook-yoga-mac-test</string>
|
||||
<string>com.facebook.facebook-yoga-mac-sample</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
@@ -8,7 +8,7 @@
|
||||
|
||||
using AppKit;
|
||||
|
||||
namespace Facebook.Yoga.Mac.Test
|
||||
namespace Facebook.Yoga.Mac.Sample
|
||||
{
|
||||
static class MainClass
|
||||
{
|
@@ -10,11 +10,11 @@
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Facebook.Yoga.Mac.Test" id="1Xt-HY-uBw">
|
||||
<menuItem title="Facebook.Yoga.Mac.Sample" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask" />
|
||||
<menu key="submenu" title="Facebook.Yoga.Mac.Test" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<menu key="submenu" title="Facebook.Yoga.Mac.Sample" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Facebook.Yoga.Mac.Test" id="5kV-Vb-QxS">
|
||||
<menuItem title="About Facebook.Yoga.Mac.Sample" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask" />
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem" />
|
||||
@@ -28,7 +28,7 @@
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5" />
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R" />
|
||||
<menuItem title="Hide Facebook.Yoga.Mac.Test" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<menuItem title="Hide Facebook.Yoga.Mac.Sample" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68" />
|
||||
</connections>
|
||||
@@ -46,7 +46,7 @@
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT" />
|
||||
<menuItem title="Quit Facebook.Yoga.Mac.Test" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<menuItem title="Quit Facebook.Yoga.Mac.Sample" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF" />
|
||||
</connections>
|
||||
@@ -627,7 +627,7 @@
|
||||
<modifierMask key="keyEquivalentModifierMask" />
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="Facebook.Yoga.Mac.Test Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<menuItem title="Facebook.Yoga.Mac.Sample Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no" />
|
||||
</connections>
|
@@ -13,7 +13,7 @@ using AppKit;
|
||||
using Foundation;
|
||||
using CoreGraphics;
|
||||
|
||||
namespace Facebook.Yoga.Mac.Test
|
||||
namespace Facebook.Yoga.Mac.Sample
|
||||
{
|
||||
public static class NSViewYogaExtensions
|
||||
{
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
using Foundation;
|
||||
|
||||
namespace Facebook.Yoga.Mac.Test
|
||||
namespace Facebook.Yoga.Mac.Sample
|
||||
{
|
||||
[Register("ViewController")]
|
||||
partial class ViewController
|
6
csharp/Mac/Facebook.Yoga.Mac.Tests/Entitlements.plist
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}</ProjectGuid>
|
||||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.Mac.Tests</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.Mac.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
|
||||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
<CodeSigningKey>Mac Developer</CodeSigningKey>
|
||||
<CreatePackage>false</CreatePackage>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>false</IncludeMonoRuntime>
|
||||
<UseSGen>true</UseSGen>
|
||||
<UseRefCounting>true</UseRefCounting>
|
||||
<Profiling>true</Profiling>
|
||||
<HttpClientHandler>HttpClientHandler</HttpClientHandler>
|
||||
<TlsProvider>Default</TlsProvider>
|
||||
<LinkMode>None</LinkMode>
|
||||
<XamMacArch>x86_64</XamMacArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
<CreatePackage>true</CreatePackage>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>true</IncludeMonoRuntime>
|
||||
<UseSGen>true</UseSGen>
|
||||
<UseRefCounting>true</UseRefCounting>
|
||||
<LinkMode>SdkOnly</LinkMode>
|
||||
<HttpClientHandler>HttpClientHandler</HttpClientHandler>
|
||||
<TlsProvider>Default</TlsProvider>
|
||||
<XamMacArch></XamMacArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Facebook.Yoga.Mac.csproj">
|
||||
<Project>{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}</Project>
|
||||
<Name>Facebook.Yoga.Mac</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems" Label="Shared" Condition="Exists('..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
</Project>
|
30
csharp/Mac/Facebook.Yoga.Mac.Tests/Info.plist
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Facebook.Yoga.Mac.Tests</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.facebook.facebook-yoga-mac-tests</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.11</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${AuthorCopyright}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</plist>
|
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Copyright 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -6,5 +6,15 @@
|
||||
* LICENSE-examples file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "UIView+Yoga.h"
|
||||
#import <yoga/Yoga.h>
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Facebook.Yoga.Mac.Tests
|
||||
{
|
||||
static class MainClass
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
4
csharp/Mac/Facebook.Yoga.Mac.Tests/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.4" targetFramework="xamarinmac20" />
|
||||
</packages>
|
@@ -1,25 +1,39 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac.Test", "Facebook.Yoga.Mac.Test\Facebook.Yoga.Mac.Test.csproj", "{64E0AB97-A904-4607-A535-EEA5A966C09E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac", "Facebook.Yoga.Mac.csproj", "{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac.Sample", "Facebook.Yoga.Mac.Sample\Facebook.Yoga.Mac.Sample.csproj", "{64E0AB97-A904-4607-A535-EEA5A966C09E}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{9352A9B6-F93B-45DD-8BCE-4696A62B3789}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Mac.Tests", "Facebook.Yoga.Mac.Tests\Facebook.Yoga.Mac.Tests.csproj", "{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{19A1C7D7-C9CC-476A-B604-DF6A3DE1BA71}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64E0AB97-A904-4607-A535-EEA5A966C09E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9FCB6149-DFA8-4EAA-B4DB-2E91A5D8FF77}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{91C42D32-291D-4B72-90B4-551663D60B8B} = {9352A9B6-F93B-45DD-8BCE-4696A62B3789}
|
||||
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {9352A9B6-F93B-45DD-8BCE-4696A62B3789}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
6
csharp/Mac/buck-build.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
if buck --version >/dev/null 2>&1; then true; else
|
||||
echo "SKIP: Need to install buck https://buckbuild.com/setup/getting_started.html"
|
||||
exit 0
|
||||
fi
|
||||
buck build $1
|
@@ -10,13 +10,8 @@
|
||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||
#include "stdafx.h"
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
|
@@ -20,6 +20,4 @@
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
2
csharp/iOS/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
libyoga.a
|
||||
*.userprefs
|
6
csharp/iOS/Facebook.Yoga.iOS.Tests/Entitlements.plist
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectGuid>{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.iOS.Tests</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.iOS.Tests</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<IOSDebuggerPort>28871</IOSDebuggerPort>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<DeviceSpecificBuild>false</DeviceSpecificBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<DeviceSpecificBuild>true</DeviceSpecificBuild>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
<Reference Include="MonoTouch.NUnitLite" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="LaunchScreen.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="UnitTestAppDelegate.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Facebook.Yoga.iOS\Facebook.Yoga.iOS.csproj">
|
||||
<Project>{128FB32A-C4A1-4363-BF06-0A36E700B7FA}</Project>
|
||||
<Name>Facebook.Yoga.iOS</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems" Label="Shared" Condition="Exists('..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
36
csharp/iOS/Facebook.Yoga.iOS.Tests/Info.plist
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Facebook.Yoga.iOS.Tests</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.facebook-yoga-ios-tests</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
27
csharp/iOS/Facebook.Yoga.iOS.Tests/LaunchScreen.storyboard
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS" />
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530" />
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb" />
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok" />
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder" />
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375" />
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
28
csharp/iOS/Facebook.Yoga.iOS.Tests/Main.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE-examples file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Facebook.Yoga.iOS.Tests
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "UnitTestAppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, "UnitTestAppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
53
csharp/iOS/Facebook.Yoga.iOS.Tests/UnitTestAppDelegate.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Copyright 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE-examples file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using MonoTouch.NUnit.UI;
|
||||
|
||||
namespace Facebook.Yoga.iOS.Tests
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("UnitTestAppDelegate")]
|
||||
public partial class UnitTestAppDelegate : UIApplicationDelegate
|
||||
{
|
||||
// class-level declarations
|
||||
UIWindow window;
|
||||
TouchRunner runner;
|
||||
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
// create a new window instance based on the screen size
|
||||
window = new UIWindow(UIScreen.MainScreen.Bounds);
|
||||
runner = new TouchRunner(window);
|
||||
|
||||
// register every tests included in the main application/assembly
|
||||
runner.Add(System.Reflection.Assembly.GetExecutingAssembly());
|
||||
|
||||
window.RootViewController = new UINavigationController(runner.GetViewController());
|
||||
|
||||
// make the window visible
|
||||
window.MakeKeyAndVisible();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
81
csharp/iOS/Facebook.Yoga.iOS.sln
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.iOS", "Facebook.Yoga.iOS\Facebook.Yoga.iOS.csproj", "{128FB32A-C4A1-4363-BF06-0A36E700B7FA}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{89A39C6B-6A7B-4458-872B-A0456550CAA6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.iOS.Tests", "Facebook.Yoga.iOS.Tests\Facebook.Yoga.iOS.Tests.csproj", "{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{128FB32A-C4A1-4363-BF06-0A36E700B7FA}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|Any CPU.ActiveCfg = Release|iPhone
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|Any CPU.Build.0 = Release|iPhone
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{FCF0BE59-AE56-4D4F-8524-94532B2DFC71}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{91C42D32-291D-4B72-90B4-551663D60B8B} = {89A39C6B-6A7B-4458-872B-A0456550CAA6}
|
||||
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {89A39C6B-6A7B-4458-872B-A0456550CAA6}
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
Policies = $0
|
||||
$0.TextStylePolicy = $1
|
||||
$1.inheritsSet = VisualStudio
|
||||
$1.inheritsScope = text/plain
|
||||
$1.scope = text/x-csharp
|
||||
$0.CSharpFormattingPolicy = $2
|
||||
$2.IndentSwitchSection = True
|
||||
$2.NewLinesForBracesInProperties = True
|
||||
$2.NewLinesForBracesInAccessors = True
|
||||
$2.NewLinesForBracesInAnonymousMethods = True
|
||||
$2.NewLinesForBracesInControlBlocks = True
|
||||
$2.NewLinesForBracesInAnonymousTypes = True
|
||||
$2.NewLinesForBracesInObjectCollectionArrayInitializers = True
|
||||
$2.NewLinesForBracesInLambdaExpressionBody = True
|
||||
$2.NewLineForElse = True
|
||||
$2.NewLineForCatch = True
|
||||
$2.NewLineForFinally = True
|
||||
$2.NewLineForMembersInObjectInit = True
|
||||
$2.NewLineForMembersInAnonymousTypes = True
|
||||
$2.NewLineForClausesInQuery = True
|
||||
$2.SpacingAfterMethodDeclarationName = False
|
||||
$2.SpaceAfterMethodCallName = False
|
||||
$2.SpaceBeforeOpenSquareBracket = False
|
||||
$2.inheritsSet = Mono
|
||||
$2.inheritsScope = text/x-csharp
|
||||
$2.scope = text/x-csharp
|
||||
EndGlobalSection
|
||||
EndGlobal
|
20
csharp/iOS/Facebook.Yoga.iOS/ApiDefinition.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using CoreGraphics;
|
||||
|
||||
namespace Facebook.Yoga.iOS
|
||||
{
|
||||
//this is needed
|
||||
}
|
10
csharp/iOS/Facebook.Yoga.iOS/CustomBuildAction.targets
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CompileDependsOn>NativeLibrary;$(CompileDependsOn)</CompileDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="NativeLibrary" Outputs="$(ProjectDir)libyoga.a">
|
||||
<Exec WorkingDirectory="$(ProjectDir)" Command="$(ProjectDir)../../Mac/buck-build.sh //csharp:yoganet-ios" />
|
||||
<Copy SourceFiles="$(ProjectDir)..\..\..\buck-out\gen\csharp\yoganet-ios\libyoga.a" DestinationFiles="$(ProjectDir)libyoga.a" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
50
csharp/iOS/Facebook.Yoga.iOS/Facebook.Yoga.iOS.csproj
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{128FB32A-C4A1-4363-BF06-0A36E700B7FA}</ProjectGuid>
|
||||
<ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Facebook.Yoga.iOS</RootNamespace>
|
||||
<AssemblyName>Facebook.Yoga.iOS</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="CustomBuildAction.targets" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<NativeReference Include="libyoga.a">
|
||||
<Kind>Static</Kind>
|
||||
<SmartLink>False</SmartLink>
|
||||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems" Label="Shared" Condition="Exists('..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
|
||||
<Import Project="CustomBuildAction.targets" />
|
||||
</Project>
|
23
csharp/iOS/Facebook.YogaKit.iOS.Sample/AppDelegate.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Facebook.YogaKit.iOS.Sample
|
||||
{
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
public override UIWindow Window
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,157 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "29x29",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "29x29",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "29x29",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "40x40",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "40x40",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "57x57",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "57x57",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "60x60",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "60x60",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "29x29",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "29x29",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "40x40",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "40x40",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "50x50",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "50x50",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "72x72",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "72x72",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "76x76",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "76x76",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "24x24",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "notificationCenter",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "27.5x27.5",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "notificationCenter",
|
||||
"subtype": "42mm"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "watch",
|
||||
"role": "companionSettings",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "watch",
|
||||
"role": "companionSettings",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "appLauncher",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "44x44",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "longLook",
|
||||
"subtype": "42mm"
|
||||
},
|
||||
{
|
||||
"size": "86x86",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "quickLook",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "98x98",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"role": "quickLook",
|
||||
"subtype": "42mm"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectGuid>{6A094B74-FA9A-4E49-A8E1-F450A04E3E5B}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Facebook.YogaKit.iOS.Sample</RootNamespace>
|
||||
<AssemblyName>Facebook.YogaKit.iOS.Sample</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;__IOS__</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<IOSDebuggerPort>56768</IOSDebuggerPort>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<DeviceSpecificBuild>false</DeviceSpecificBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType></DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<DeviceSpecificBuild>true</DeviceSpecificBuild>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\Contents.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="LaunchScreen.storyboard" />
|
||||
<InterfaceDefinition Include="Main.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="ViewController.cs" />
|
||||
<Compile Include="ViewController.designer.cs">
|
||||
<DependentUpon>ViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Facebook.YogaKit.iOS\Facebook.YogaKit.iOS.csproj">
|
||||
<Project>{0C38AA9D-3178-4B43-9C3B-3C97A90FB1B0}</Project>
|
||||
<Name>Facebook.YogaKit.iOS</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Facebook.Yoga.iOS\Facebook.Yoga.iOS.csproj">
|
||||
<Project>{128FB32A-C4A1-4363-BF06-0A36E700B7FA}</Project>
|
||||
<Name>Facebook.Yoga.iOS</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
39
csharp/iOS/Facebook.YogaKit.iOS.Sample/Info.plist
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Facebook.YogaKit.iOS.Sample</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.facebook-yogakit-ios-sample</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>10.2</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS" />
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530" />
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb" />
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok" />
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder" />
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375" />
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
12
csharp/iOS/Facebook.YogaKit.iOS.Sample/Main.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using UIKit;
|
||||
|
||||
namespace Facebook.YogaKit.iOS.Sample
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
UIApplication.Main(args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
25
csharp/iOS/Facebook.YogaKit.iOS.Sample/Main.storyboard
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204" />
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ" />
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE" />
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder" />
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
54
csharp/iOS/Facebook.YogaKit.iOS.Sample/ViewController.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using CoreGraphics;
|
||||
using Facebook.Yoga;
|
||||
using UIKit;
|
||||
|
||||
namespace Facebook.YogaKit.iOS.Sample
|
||||
{
|
||||
public partial class ViewController : UIViewController
|
||||
{
|
||||
protected ViewController(IntPtr handle) : base(handle)
|
||||
{
|
||||
// Note: this .ctor should not contain any initialization logic.
|
||||
}
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
CreateViewHierarchy(View, View.Bounds.Size.Width, View.Bounds.Size.Height);
|
||||
}
|
||||
|
||||
static void CreateViewHierarchy(UIView root, nfloat width, nfloat height)
|
||||
{
|
||||
root.BackgroundColor = UIColor.Red;
|
||||
root.Yoga().IsEnabled = true;
|
||||
|
||||
root.Yoga().Width = (float)width;
|
||||
root.Yoga().Height = (float)height;
|
||||
root.Yoga().AlignItems = YogaAlign.Center;
|
||||
root.Yoga().JustifyContent = YogaJustify.Center;
|
||||
|
||||
var child1 = new UIView { BackgroundColor = UIColor.Blue };
|
||||
child1.Yoga().IsEnabled = true;
|
||||
child1.Yoga().Width = 100;
|
||||
child1.Yoga().Height = 100;
|
||||
|
||||
var child2 = new UIView
|
||||
{
|
||||
BackgroundColor = UIColor.Green,
|
||||
Frame = new CGRect { Size = new CGSize(200, 100) }
|
||||
};
|
||||
|
||||
var child3 = new UIView
|
||||
{
|
||||
BackgroundColor = UIColor.Yellow,
|
||||
Frame = new CGRect { Size = new CGSize(100, 100) }
|
||||
};
|
||||
|
||||
child2.AddSubview(child3);
|
||||
root.AddSubview(child1);
|
||||
root.AddSubview(child2);
|
||||
root.Yoga().ApplyLayout();
|
||||
}
|
||||
}
|
||||
}
|
17
csharp/iOS/Facebook.YogaKit.iOS.Sample/ViewController.designer.cs
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// This file has been generated automatically by MonoDevelop to store outlets and
|
||||
// actions made in the Xcode designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using Foundation;
|
||||
|
||||
namespace Facebook.YogaKit.iOS.Sample
|
||||
{
|
||||
[Register("ViewController")]
|
||||
partial class ViewController
|
||||
{
|
||||
void ReleaseDesignerOutlets()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
6
csharp/iOS/Facebook.YogaKit.iOS.Tests/Entitlements.plist
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|