Exemplo n.º 1
0
        private void OnFieldSelected(FilledAutofillField field, FieldType fieldType)
        {
            DatasetWithFilledAutofillFields datasetWithFilledAutofillFields = new DatasetWithFilledAutofillFields();
            String newDatasetId             = Guid.NewGuid().ToString();
            FilledAutofillField copyOfField = new FilledAutofillField(newDatasetId, PackageName,
                                                                      field.GetFieldTypeName(), field.GetTextValue(), field.GetDateValue(), field.GetToggleValue());
            String          datasetName     = "dataset-manual";
            AutofillDataset autofillDataset = new AutofillDataset(newDatasetId, datasetName);

            datasetWithFilledAutofillFields.filledAutofillFields =
                new List <FilledAutofillField>()
            {
                copyOfField
            }.ToImmutableList();
            datasetWithFilledAutofillFields.autofillDataset = autofillDataset;
            Intent       intent       = Intent;
            var          structure    = (AssistStructure)intent.GetParcelableExtra(AutofillManager.ExtraAssistStructure);
            ClientParser clientParser = new ClientParser(structure);

            mReplyIntent = new Intent();
            mLocalAutofillDataSource.GetFieldTypeByAutofillHints(new DataCallback2
            {
                that         = this,
                datasetName  = datasetName,
                fieldType    = fieldType,
                field        = field,
                clientParser = clientParser
            });
        }
 public void Bind(FilledAutofillField field)
 {
     mFieldTypeText.Text = field.GetFieldTypeName();
     mRootView.Click    += delegate
     {
         ((ManualFieldPickerActivity)mActivity).OnSelectedDataset(field);
     };
 }
        public void OnSelectedDataset(FilledAutofillField field)
        {
            Intent data = new Intent()
                          .PutExtra(EXTRA_SELECTED_FIELD_DATASET_ID, field.GetDatasetId())
                          .PutExtra(EXTRA_SELECTED_FIELD_TYPE_NAME, field.GetFieldTypeName());

            SetResult(Result.Ok, data);
            Finish();
        }