Pass reason for measure pass along with measurecallbackend event (#566)

Summary:
Pull Request resolved: https://github.com/facebook/litho/pull/566

Pull Request resolved: https://github.com/facebook/react-native/pull/25702

Pass reason for each measure callback to the flipper plugin

Reviewed By: davidaurelio

Differential Revision: D16221771

fbshipit-source-id: 2e72e1ebb3c7e633d189e7a7a81d655ac9531e51
This commit is contained in:
Sidharth Guglani
2019-07-18 05:17:52 -07:00
committed by Facebook Github Bot
parent 5e40e4b682
commit e6dfe04388
5 changed files with 98 additions and 19 deletions

View File

@@ -0,0 +1,40 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
package com.facebook.yoga;
public enum LayoutPassReason {
INITIAL(0),
MEASURE(1),
ABS_MEASURE(2),
FLEX(3),
ABS_LAYOUT(4),
STRETCH(5),
MULTILINE_STRETCH(6);
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;
case 1: return MEASURE;
case 2: return ABS_MEASURE;
case 3: return FLEX;
case 4: return ABS_LAYOUT;
case 5: return STRETCH;
case 6: return MULTILINE_STRETCH;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
}