Introducing YGPositionTypeStatic
Summary: Changelog: [Internal] Fabric-specific internal change. This diff introduces a new value for `YGPositionType`: `YGPositionTypeStatic`. No part of Yoga, RN, Litho or CK uses this value yet. `relative` and `static` values behave the same way for now. We also do not change any defaults. So, it should be fine. Reviewed By: SidharthGuglani Differential Revision: D22386732 fbshipit-source-id: 39cd9e818458ac2a91efb175f24a74c8c303ff08
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5ac5624e3f
commit
fc88b2f774
@@ -120,8 +120,9 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
YGOverflowHidden:{value:'YogaOverflow.Hidden'},
|
||||
YGOverflowVisible:{value:'YogaOverflow.Visible'},
|
||||
|
||||
YGPositionTypeAbsolute:{value:'YogaPositionType.Absolute'},
|
||||
YGPositionTypeAbsolute:{value:'YogaPositionType.Static'},
|
||||
YGPositionTypeRelative:{value:'YogaPositionType.Relative'},
|
||||
YGPositionTypeAbsolute:{value:'YogaPositionType.Absolute'},
|
||||
|
||||
YGUndefined:{value:'YogaConstants.Undefined'},
|
||||
|
||||
|
@@ -8,8 +8,9 @@
|
||||
package com.facebook.yoga;
|
||||
|
||||
public enum YogaPositionType {
|
||||
RELATIVE(0),
|
||||
ABSOLUTE(1);
|
||||
STATIC(0),
|
||||
RELATIVE(1),
|
||||
ABSOLUTE(2);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
@@ -23,8 +24,9 @@ public enum YogaPositionType {
|
||||
|
||||
public static YogaPositionType fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return RELATIVE;
|
||||
case 1: return ABSOLUTE;
|
||||
case 0: return STATIC;
|
||||
case 1: return RELATIVE;
|
||||
case 2: return ABSOLUTE;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ TEST(YogaTest, assert_default_values) {
|
||||
ASSERT_EQ(YGAlignFlexStart, YGNodeStyleGetAlignContent(root));
|
||||
ASSERT_EQ(YGAlignStretch, YGNodeStyleGetAlignItems(root));
|
||||
ASSERT_EQ(YGAlignAuto, YGNodeStyleGetAlignSelf(root));
|
||||
ASSERT_EQ(YGPositionTypeRelative, YGNodeStyleGetPositionType(root));
|
||||
ASSERT_EQ(YGPositionTypeStatic, YGNodeStyleGetPositionType(root));
|
||||
ASSERT_EQ(YGWrapNoWrap, YGNodeStyleGetFlexWrap(root));
|
||||
ASSERT_EQ(YGOverflowVisible, YGNodeStyleGetOverflow(root));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeStyleGetFlexGrow(root));
|
||||
|
@@ -132,9 +132,10 @@ ACCESSOR_TEST(
|
||||
|
||||
ACCESSOR_TEST(
|
||||
positionType,
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeStatic,
|
||||
YGPositionTypeAbsolute,
|
||||
YGPositionTypeRelative)
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeStatic)
|
||||
|
||||
ACCESSOR_TEST(
|
||||
flexWrap,
|
||||
|
@@ -179,6 +179,8 @@ const char* YGOverflowToString(const YGOverflow value) {
|
||||
|
||||
const char* YGPositionTypeToString(const YGPositionType value) {
|
||||
switch (value) {
|
||||
case YGPositionTypeStatic:
|
||||
return "static";
|
||||
case YGPositionTypeRelative:
|
||||
return "relative";
|
||||
case YGPositionTypeAbsolute:
|
||||
|
@@ -128,7 +128,11 @@ YG_ENUM_SEQ_DECL(
|
||||
YGOverflowHidden,
|
||||
YGOverflowScroll)
|
||||
|
||||
YG_ENUM_SEQ_DECL(YGPositionType, YGPositionTypeRelative, YGPositionTypeAbsolute)
|
||||
YG_ENUM_SEQ_DECL(
|
||||
YGPositionType,
|
||||
YGPositionTypeStatic,
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeAbsolute)
|
||||
|
||||
YG_ENUM_DECL(
|
||||
YGPrintOptions,
|
||||
|
Reference in New Issue
Block a user