Permalink
Browse files

Fixing Crush on SDK 15 (ICS) on ReactTextInputLocalData

Summary:
We had a crush reprot from Loadstone (manual tests) for RN standalone app on ICS, see:
https://our.intern.facebook.com/intern/tasks/view_inline_attachment/?attachment_id=2296063267087587&fbid=314266832445741

Seems like we are using TextView.getMinLines and TextView.getMaxLines - both added in SDK 16, witought a propert guard. see:
https://developer.android.com/reference/android/widget/TextView#getMinLines()
https://developer.android.com/reference/android/widget/TextView#getMaxLines()

Reviewed By: shergin

Differential Revision: D8763942

fbshipit-source-id: a56a6fc3e575b8ea97ddab983561df878b2f341c
  • Loading branch information...
Noam Schachter authored and facebook-github-bot committed Jul 10, 2018
1 parent a69c330 commit 1bb2bead8bef850037c8b72209cd72a442572821
@@ -25,10 +25,16 @@
public ReactTextInputLocalData(EditText editText) {
mText = new SpannableStringBuilder(editText.getText());
mTextSize = editText.getTextSize();
mMinLines = editText.getMinLines();
mMaxLines = editText.getMaxLines();
mInputType = editText.getInputType();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mMinLines = editText.getMinLines();
mMaxLines = editText.getMaxLines();
} else {
mMinLines = 1;
mMaxLines = 1;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mBreakStrategy = editText.getBreakStrategy();
} else {

0 comments on commit 1bb2bea

Please sign in to comment.