本文整理汇总了Java中org.chromium.chrome.browser.payments.ui.EditorFieldModel.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java EditorFieldModel.setLabel方法的具体用法?Java EditorFieldModel.setLabel怎么用?Java EditorFieldModel.setLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.chrome.browser.payments.ui.EditorFieldModel
的用法示例。
在下文中一共展示了EditorFieldModel.setLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAddressTextFieldsToEditor
import org.chromium.chrome.browser.payments.ui.EditorFieldModel; //导入方法依赖的package包/类
/**
* 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);
}
}
示例2: addAddressFieldsToEditor
import org.chromium.chrome.browser.payments.ui.EditorFieldModel; //导入方法依赖的package包/类
/**
* 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);
}