From 549e6a3fbe3db272f38ae17b81b9f1d03fe5a84d Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Wed, 22 May 2019 12:02:09 +0200 Subject: [PATCH] add getters for private values in ReactTextInputShadowNode --- .../textinput/ReactTextInputShadowNode.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java index 3f00b8718b3ad6..92cb209d832bb3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java @@ -18,14 +18,9 @@ import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.common.annotations.VisibleForTesting; -import com.facebook.react.uimanager.LayoutShadowNode; -import com.facebook.react.uimanager.NativeViewHierarchyOptimizer; -import com.facebook.react.uimanager.PixelUtil; -import com.facebook.react.uimanager.ReactShadowNodeImpl; import com.facebook.react.uimanager.Spacing; import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.UIViewOperationQueue; -import com.facebook.react.uimanager.ViewDefaults; import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.react.views.text.ReactBaseTextShadowNode; import com.facebook.react.views.text.ReactTextUpdate; @@ -157,6 +152,10 @@ public void setMostRecentEventCount(int mostRecentEventCount) { mMostRecentEventCount = mostRecentEventCount; } + public int getMostRecentEventCount() { + return mMostRecentEventCount; + } + @ReactProp(name = PROP_TEXT) public void setText(@Nullable String text) { mText = text; @@ -190,6 +189,14 @@ public void setSelection(@Nullable ReadableMap selection) { } } + public int getSelectionStart() { + return mSelectionStart; + } + + public int getSelectionEnd() { + return mSelectionEnd; + } + @Override public void setTextBreakStrategy(@Nullable String textBreakStrategy) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {