Adding node type and moving rounding dependency to rely on that type

Reviewed By: emilsjolander

Differential Revision: D5025107

fbshipit-source-id: a8d66e2f9c5d02ab080784cc474be583a09b92e2
This commit is contained in:
Georgiy Kassabli
2017-05-11 08:09:30 -07:00
committed by Facebook Github Bot
parent c15a6b6202
commit 70b7488f97
5 changed files with 99 additions and 37 deletions

View File

@@ -0,0 +1,36 @@
/**
* 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.
*/
package com.facebook.yoga;
import com.facebook.proguard.annotations.DoNotStrip;
@DoNotStrip
public enum YogaNodeType {
DEFAULT(0),
TEXT(1);
private int mIntValue;
YogaNodeType(int intValue) {
mIntValue = intValue;
}
public int intValue() {
return mIntValue;
}
public static YogaNodeType fromInt(int value) {
switch (value) {
case 0: return DEFAULT;
case 1: return TEXT;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
}