Make edittext padding fix to nodes as well

Reviewed By: ahmedre

Differential Revision: D4397500

fbshipit-source-id: abf116847cbf98cccba07f1e08d8aab47a35123b
This commit is contained in:
Emil Sjolander 2017-01-10 18:04:49 -08:00 committed by Facebook Github Bot
parent 669c84f11e
commit 1d9ba508c4

View File

@ -73,6 +73,7 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, YogaMea
setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());
setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());
setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());
mEditText.setPadding(0, 0, 0, 0);
}
@Override
@ -90,11 +91,6 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, YogaMea
TypedValue.COMPLEX_UNIT_PX,
fontSize == UNSET ?
(int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)) : fontSize);
editText.setPadding(
(int) Math.ceil(getPadding(Spacing.START)),
(int) Math.ceil(getPadding(Spacing.TOP)),
(int) Math.ceil(getPadding(Spacing.END)),
(int) Math.ceil(getPadding(Spacing.BOTTOM)));
if (mNumberOfLines != UNSET) {
editText.setLines(mNumberOfLines);