Java Code Examples for org.chromium.chrome.browser.payments.ui.EditorFieldModel#setRequiredErrorMessage()
The following examples show how to use
org.chromium.chrome.browser.payments.ui.EditorFieldModel#setRequiredErrorMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddressEditor.java From delion with Apache License 2.0 | 5 votes |
/** * Adds text fields to the editor model based on the country and language code of the profile * that's being edited. */ private void addAddressTextFieldsToEditor( EditorModel container, String countryCode, String languageCode) { mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode); for (int i = 0; i < mAddressUiComponents.size(); i++) { AddressUiComponent component = mAddressUiComponents.get(i); // The country field is a dropdown, so there's no need to add a text field for it. if (component.id == AddressField.COUNTRY) continue; EditorFieldModel field = mAddressFields.get(component.id); // Labels depend on country, e.g., state is called province in some countries. These are // already localized. field.setLabel(component.label); field.setIsFullLine(component.isFullLine); // Libaddressinput formats do not always require the full name (RECIPIENT), but // PaymentRequest does. if (component.isRequired || component.id == AddressField.RECIPIENT) { field.setRequiredErrorMessage(mContext.getString( R.string.payments_address_field_required_validation_message)); } else { field.setRequiredErrorMessage(null); } container.addField(field); } }
Example 2
Source File: AddressEditor.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Adds text fields to the editor model based on the country and language code of the profile * that's being edited. */ private void addAddressTextFieldsToEditor( EditorModel container, String countryCode, String languageCode) { mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode); for (int i = 0; i < mAddressUiComponents.size(); i++) { AddressUiComponent component = mAddressUiComponents.get(i); // The country field is a dropdown, so there's no need to add a text field for it. if (component.id == AddressField.COUNTRY) continue; EditorFieldModel field = mAddressFields.get(component.id); // Labels depend on country, e.g., state is called province in some countries. These are // already localized. field.setLabel(component.label); field.setIsFullLine(component.isFullLine); // Libaddressinput formats do not always require the full name (RECIPIENT), but // PaymentRequest does. if (component.isRequired || component.id == AddressField.RECIPIENT) { field.setRequiredErrorMessage(mContext.getString( R.string.payments_field_required_validation_message)); } else { field.setRequiredErrorMessage(null); } container.addField(field); } }
Example 3
Source File: AddressEditor.java From 365browser with Apache License 2.0 | 5 votes |
/** * Adds fields to the editor model based on the country and language code of * the profile that's being edited. */ private void addAddressFieldsToEditor( String countryCode, String languageCode, String[] adminAreas) { mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode); // In terms of order, country must be the first field. mEditor.addField(mCountryField); for (int i = 0; i < mAddressUiComponents.size(); i++) { AddressUiComponent component = mAddressUiComponents.get(i); EditorFieldModel field = mAddressFields.get(component.id); // Labels depend on country, e.g., state is called province in some countries. These are // already localized. field.setLabel(component.label); field.setIsFullLine(component.isFullLine || component.id == AddressField.LOCALITY || component.id == AddressField.DEPENDENT_LOCALITY); if (component.id == AddressField.ADMIN_AREA && field.isDropdownField()) { field.setDropdownKeyValues( mAutofillProfileBridge.getAdminAreaDropdownList(adminAreas)); } // Libaddressinput formats do not always require the full name (RECIPIENT), but // PaymentRequest does. if (component.isRequired || component.id == AddressField.RECIPIENT) { field.setRequiredErrorMessage(mContext.getString( R.string.payments_field_required_validation_message)); } else { field.setRequiredErrorMessage(null); } mEditor.addField(field); } // Phone number must be the last field. mEditor.addField(mPhoneField); }