コード例 #1
0
        private void OnSuccess()
        {
            var intent      = Intent;
            var forResponse = intent.GetBooleanExtra(CommonUtil.EXTRA_FOR_RESPONSE, true);
            var structure   = (AssistStructure)intent.GetParcelableExtra(AutofillManager.ExtraAssistStructure);
            var parser      = new StructureParser(ApplicationContext, structure);

            parser.ParseForFill();
            var autofillFields = parser.GetAutofillFields();

            mReplyIntent = new Intent();
            var clientFormDataMap = SharedPrefsAutofillRepository.GetInstance().GetFilledAutofillFieldCollection
                                        (this, autofillFields.GetFocusedHints(), autofillFields.GetAllHints());

            if (forResponse)
            {
                SetResponseIntent(AutofillHelper.NewResponse
                                      (this, false, autofillFields, clientFormDataMap));
            }
            else
            {
                var datasetName = intent.GetStringExtra(CommonUtil.EXTRA_DATASET_NAME);
                SetDatasetIntent(AutofillHelper.NewDataset
                                     (this, autofillFields, clientFormDataMap[datasetName], false));
            }
        }
コード例 #2
0
        protected void OnSuccess()
        {
            var             intent      = Intent;
            var             forResponse = intent.GetBooleanExtra(CommonUtil.EXTRA_FOR_RESPONSE, true);
            AssistStructure structure   = (AssistStructure)intent.GetParcelableExtra(AutofillManager.ExtraAssistStructure);
            StructureParser parser      = new StructureParser(structure);

            parser.ParseForFill();
            AutofillFieldMetadataCollection autofillFields = parser.AutofillFields;
            var saveTypes = autofillFields.SaveType;

            ReplyIntent = new Intent();
            var clientFormDataMap = SharedPrefsAutofillRepository.GetInstance(this).GetFilledAutofillFieldCollection
                                        (autofillFields.FocusedAutofillHints, autofillFields.AllAutofillHints);

            if (forResponse)
            {
                SetResponseIntent(AutofillHelper.NewResponse(this, false, autofillFields, clientFormDataMap));
            }
            else
            {
                String datasetName = intent.GetStringExtra(CommonUtil.EXTRA_DATASET_NAME);
                SetDatasetIntent(AutofillHelper.NewDataset(this, autofillFields, clientFormDataMap[datasetName], false));
            }
        }