From 6570f7887b8824705ae09b5653d631428e17bc5f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 13 May 2020 15:41:41 -0700 Subject: [PATCH] Extend ReactShadowNode API to expose flex props Summary: This diff extends the ReactShadowNode API to expose flex props, this is going to be used by some components that require access to it changeLog: [Android][Added] Exposed getFlex method as part of ReactShadowNode API Reviewed By: JoshuaGross Differential Revision: D21554663 fbshipit-source-id: 26c9a3fe5f72a84120b16b553ab08231817c0efa --- .../java/com/facebook/react/uimanager/ReactShadowNode.java | 2 ++ .../com/facebook/react/uimanager/ReactShadowNodeImpl.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java index fc13de9c5ccef7..c21eaecad3630a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java @@ -288,6 +288,8 @@ public interface ReactShadowNode { YogaValue getStyleHeight(); + float getFlex(); + void setStyleHeight(float heightPx); void setStyleHeightPercent(float percent); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java index 6c58ae2d7b93d1..18aaad08112ad5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java @@ -779,6 +779,11 @@ public void setStyleMaxHeightPercent(float percent) { mYogaNode.setMaxHeightPercent(percent); } + @Override + public float getFlex() { + return mYogaNode.getFlex(); + } + @Override public void setFlex(float flex) { mYogaNode.setFlex(flex);