public FilledAutofillField(ViewNode viewNode) { _autofillHints = AutofillHelper.FilterForSupportedHints(viewNode.GetAutofillHints()); var autofillValue = viewNode.AutofillValue; if (autofillValue != null) { if (autofillValue.IsList) { var autofillOptions = viewNode.GetAutofillOptions(); int index = autofillValue.ListValue; if (autofillOptions != null && autofillOptions.Length > 0) { TextValue = autofillOptions[index]; } } else if (autofillValue.IsDate) { DateValue = autofillValue.DateValue; } else if (autofillValue.IsText) { // Using toString of AutofillValue.getTextValue in order to save it to // SharedPreferences. TextValue = autofillValue.TextValue; } } }
public AutofillFieldMetadata(ViewNode view) { _autofillOptions = view.GetAutofillOptions(); Id = view.Id; AutofillId = view.AutofillId; AutofillType = (AutofillType)(int)view.AutofillType; InputType = (InputTypes)(int)view.InputType; IsFocused = view.IsFocused; AutofillHints = AutofillHelper.FilterForSupportedHints(view.GetAutofillHints())?.ToList() ?? new List <string>(); }