Skip to content

Commit

Permalink
Allow overriding EditText construction in ReactTextInputShadowNode
Browse files Browse the repository at this point in the history
  • Loading branch information
mchowning committed Jan 15, 2020
1 parent f11937e commit bdfbbbe
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -249,4 +249,8 @@ public void setPadding(int spacingType, float padding) {
super.setPadding(spacingType, padding);
markUpdated();
}

protected EditText createDummyEditText() {
return new EditText(getThemedContext());
}
}

0 comments on commit bdfbbbe

Please sign in to comment.