add node measure event and passing the callback to java layer

Summary: Adds measure event and its listener initial code structure

Reviewed By: davidaurelio

Differential Revision: D15600738

fbshipit-source-id: d15764e0b64edb170fcb15e0912ecce5f7e53595
This commit is contained in:
Sidharth Guglani
2019-06-06 21:03:04 -07:00
committed by Facebook Github Bot
parent c44b221e13
commit 348c3ebefa
3 changed files with 14 additions and 2 deletions
@@ -10,4 +10,6 @@ public interface YogaEventListener {
void onLayoutPassEnd(YogaNode node);
}
void onNodeMeasure(YogaNode node);
}
+4
View File
@@ -1635,6 +1635,10 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
heightMeasureMode,
layoutContext);
#ifdef YG_ENABLE_EVENTS
Event::publish<Event::NodeMeasure>(node, {layoutContext});
#endif
node->setLayoutMeasuredDimension(
YGNodeBoundAxis(
node,
+7 -1
View File
@@ -21,7 +21,8 @@ struct Event {
NodeDeallocation,
NodeLayout,
LayoutPassStart,
LayoutPassEnd
LayoutPassEnd,
NodeMeasure,
};
class Data;
using Subscriber = void(const YGNode&, Type, Data);
@@ -76,5 +77,10 @@ struct Event::TypedData<Event::LayoutPassEnd> {
void* layoutContext;
};
template <>
struct Event::TypedData<Event::NodeMeasure> {
void* layoutContext;
};
} // namespace yoga
} // namespace facebook