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:
Valentin Shergin
2020-07-20 00:31:15 -07:00
committed by Facebook GitHub Bot
parent 123423c2a9
commit ec60ebe792
6 changed files with 29 additions and 6 deletions
@@ -779,6 +779,11 @@ public class LayoutShadowNode extends ReactShadowNodeImpl {
}
switch (position) {
case "static":
{
setPositionType(YogaPositionType.STATIC);
break;
}
case "relative":
{
setPositionType(YogaPositionType.RELATIVE);
@@ -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);
}
}