diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java index 73839812ca68f6..2ad1a1c3a37315 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java @@ -21,13 +21,13 @@ public class ReactContentSizeChangedEvent extends Event { public static final String EVENT_NAME = "topContentSizeChange"; - private int mContentWidth; - private int mContentHeight; + private float mContentWidth; + private float mContentHeight; public ReactContentSizeChangedEvent( int viewId, - int contentSizeWidth, - int contentSizeHeight) { + float contentSizeWidth, + float contentSizeHeight) { super(viewId); mContentWidth = contentSizeWidth; mContentHeight = contentSizeHeight; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java index 2345f15c5ef65a..67ca37c5e682f2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java @@ -23,15 +23,15 @@ public class ReactTextChangedEvent extends Event { public static final String EVENT_NAME = "topChange"; private String mText; - private int mContentWidth; - private int mContentHeight; + private float mContentWidth; + private float mContentHeight; private int mEventCount; public ReactTextChangedEvent( int viewId, String text, - int contentSizeWidth, - int contentSizeHeight, + float contentSizeWidth, + float contentSizeHeight, int eventCount) { super(viewId); mText = text; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index be3568be167e34..89e2f10149d457 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -590,8 +590,8 @@ public void onTextChanged(CharSequence s, int start, int before, int count) { new ReactTextChangedEvent( mEditText.getId(), s.toString(), - (int) PixelUtil.toDIPFromPixel(contentWidth), - (int) PixelUtil.toDIPFromPixel(contentHeight), + PixelUtil.toDIPFromPixel(contentWidth), + PixelUtil.toDIPFromPixel(contentHeight), mEditText.incrementAndGetEventCounter())); mEventDispatcher.dispatchEvent( @@ -683,7 +683,7 @@ public void onLayout() { contentWidth = mEditText.getCompoundPaddingLeft() + mEditText.getLayout().getWidth() + mEditText.getCompoundPaddingRight(); contentHeight = mEditText.getCompoundPaddingTop() + mEditText.getLayout().getHeight() + - mEditText.getCompoundPaddingTop(); + mEditText.getCompoundPaddingBottom(); } if (contentWidth != mPreviousContentWidth || contentHeight != mPreviousContentHeight) { @@ -693,8 +693,8 @@ public void onLayout() { mEventDispatcher.dispatchEvent( new ReactContentSizeChangedEvent( mEditText.getId(), - (int) PixelUtil.toDIPFromPixel(contentWidth), - (int) PixelUtil.toDIPFromPixel(contentHeight))); + PixelUtil.toDIPFromPixel(contentWidth), + PixelUtil.toDIPFromPixel(contentHeight))); } } }