mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 17:30:38 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
a69c330347
commit
1bb2bead8b
@@ -25,10 +25,16 @@ public final class ReactTextInputLocalData {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user