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 eeda18dedf5cba..5e9545cffc7794 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 @@ -75,7 +75,7 @@ public void setThemedContext(ThemedReactContext themedContext) { // of Android), and it cannot be changed. // So, we have to enforce it as a default padding. // TODO #7120264: Cache this stuff better. - EditText editText = new EditText(getThemedContext()); + EditText editText = createDummyEditText(); setDefaultPadding(Spacing.START, ViewCompat.getPaddingStart(editText)); setDefaultPadding(Spacing.TOP, editText.getPaddingTop()); setDefaultPadding(Spacing.END, ViewCompat.getPaddingEnd(editText)); @@ -249,4 +249,8 @@ public void setPadding(int spacingType, float padding) { super.setPadding(spacingType, padding); markUpdated(); } + + protected EditText createDummyEditText() { + return new EditText(getThemedContext()); + } }