|
10 | 10 | import android.graphics.PorterDuff;
|
11 | 11 | import android.graphics.Typeface;
|
12 | 12 | import android.graphics.drawable.Drawable;
|
| 13 | +import android.os.Build; |
13 | 14 | import android.support.v4.content.ContextCompat;
|
14 | 15 | import android.text.Editable;
|
15 | 16 | import android.text.InputFilter;
|
@@ -280,6 +281,24 @@ public void setSelection(ReactEditText view, @Nullable ReadableMap selection) {
|
280 | 281 | }
|
281 | 282 | }
|
282 | 283 |
|
| 284 | + @ReactProp(name = "importantForAutofill") |
| 285 | + public void setImportantForAutofill(ReactEditText view, @Nullable String value) { |
| 286 | + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { |
| 287 | + return; |
| 288 | + } |
| 289 | + int mode = View.IMPORTANT_FOR_AUTOFILL_AUTO; |
| 290 | + if ("no".equals(value)) { |
| 291 | + mode = View.IMPORTANT_FOR_AUTOFILL_NO; |
| 292 | + } else if ("noExcludeDescendants".equals(value)) { |
| 293 | + mode = View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS; |
| 294 | + } else if ("yes".equals(value)) { |
| 295 | + mode = View.IMPORTANT_FOR_AUTOFILL_YES; |
| 296 | + } else if ("yesExcludeDescendants".equals(value)) { |
| 297 | + mode = View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS; |
| 298 | + } |
| 299 | + view.setImportantForAutofill(mode); |
| 300 | + } |
| 301 | + |
283 | 302 | @ReactProp(name = "onSelectionChange", defaultBoolean = false)
|
284 | 303 | public void setOnSelectionChange(final ReactEditText view, boolean onSelectionChange) {
|
285 | 304 | if (onSelectionChange) {
|
|
0 commit comments