mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Feature auto margin
Summary: Even so I know there are some opinions against ```margin: 0 auto``` it's still part of the spec: https://www.w3.org/TR/css-flexbox-1/#auto-margins and pretty usefull if you have to position via ```justify-content```. This PR adds an implementation for that. It adds an additonal ```YGUnitAuto``` and margins got ```YGNodeStyleSetMarginAuto``` functions as well. Closes https://github.com/facebook/yoga/pull/357 Reviewed By: astreet Differential Revision: D4501142 Pulled By: emilsjolander fbshipit-source-id: 86519f8632496f46e78a7c9dbc5b21e212e3e0c7
This commit is contained in:
1 parent
934cd82941
commit
dbaa687518
8 files changed
+196
-48
No files matched your search
@@ -15,7 +15,8 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
public enum YogaUnit {
|
||||
UNDEFINED(0),
|
||||
PIXEL(1),
|
||||
PERCENT(2);
|
||||
PERCENT(2),
|
||||
AUTO(3);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
@@ -32,6 +33,7 @@ public enum YogaUnit {
|
||||
case 0: return UNDEFINED;
|
||||
case 1: return PIXEL;
|
||||
case 2: return PERCENT;
|
||||
case 3: return AUTO;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user