add node layout event and pass it java layer
Summary: Listen to NodeLayout event and passes this event callback to java layer along with the information whether layout or measure was done in this pass Reviewed By: davidaurelio Differential Revision: D15696021 fbshipit-source-id: 8c5ca69330a9baca26b77052d4965cc67fe97c75
This commit is contained in:
committed by
Facebook Github Bot
parent
e33123f955
commit
af219f8836
@@ -12,4 +12,6 @@ public interface YogaEventListener {
|
||||
|
||||
void onNodeMeasure(YogaNode node);
|
||||
|
||||
void onNodeLayout(YogaNode node, boolean performLayout);
|
||||
|
||||
}
|
||||
|
@@ -3670,7 +3670,7 @@ bool YGLayoutNodeInternal(
|
||||
YGMarkerLayoutData& layoutMarkerData,
|
||||
void* const layoutContext) {
|
||||
#ifdef YG_ENABLE_EVENTS
|
||||
Event::publish<Event::NodeLayout>(node);
|
||||
Event::publish<Event::NodeLayout>(node, {performLayout, layoutContext});
|
||||
#endif
|
||||
YGLayout* layout = &node->getLayout();
|
||||
|
||||
|
@@ -82,5 +82,11 @@ struct Event::TypedData<Event::NodeMeasure> {
|
||||
void* layoutContext;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Event::TypedData<Event::NodeLayout> {
|
||||
bool performLayout;
|
||||
void* layoutContext;
|
||||
};
|
||||
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
Reference in New Issue
Block a user