2019-10-15 10:30:08 -07:00
|
|
|
/*
|
2021-12-30 15:08:43 -08:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2019-07-18 05:17:52 -07:00
|
|
|
*
|
2019-10-15 10:30:08 -07:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2019-07-18 05:17:52 -07:00
|
|
|
*/
|
2019-10-15 10:30:08 -07:00
|
|
|
|
2019-07-18 05:17:52 -07:00
|
|
|
package com.facebook.yoga;
|
|
|
|
|
|
|
|
public enum LayoutPassReason {
|
|
|
|
INITIAL(0),
|
2019-07-31 14:33:36 -07:00
|
|
|
ABS_LAYOUT(1),
|
|
|
|
STRETCH(2),
|
|
|
|
MULTILINE_STRETCH(3),
|
|
|
|
FLEX_LAYOUT(4),
|
|
|
|
MEASURE(5),
|
|
|
|
ABS_MEASURE(6),
|
|
|
|
FLEX_MEASURE(7);
|
2019-07-18 05:17:52 -07:00
|
|
|
|
|
|
|
private final int mIntValue;
|
|
|
|
|
|
|
|
LayoutPassReason(int intValue) {
|
|
|
|
mIntValue = intValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int intValue() {
|
|
|
|
return mIntValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static LayoutPassReason fromInt(int value) {
|
|
|
|
switch (value) {
|
|
|
|
case 0: return INITIAL;
|
2019-07-31 14:33:36 -07:00
|
|
|
case 1: return ABS_LAYOUT;
|
|
|
|
case 2: return STRETCH;
|
|
|
|
case 3: return MULTILINE_STRETCH;
|
|
|
|
case 4: return FLEX_LAYOUT;
|
|
|
|
case 5: return MEASURE;
|
|
|
|
case 6: return ABS_MEASURE;
|
|
|
|
case 7: return FLEX_MEASURE;
|
2019-07-18 05:17:52 -07:00
|
|
|
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|