public abstract class CountryCodeHelper
extends java.lang.Object
| Constructor and Description |
|---|
CountryCodeHelper(android.content.res.Resources resources,
com.yoti.mobile.android.common.ui.components.utils.IDemonymProvider demonymProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.util.Locale[] |
getAvailableLocales() |
java.util.List<Country> |
getCountriesForDeviceSupportedPhoneCode()
This method is generating a sorted list of countries from the list of
supported regions phone codes which are not always countries.
|
Country |
getCountryForCode(java.lang.String countryCodeIso2OrIso3) |
java.util.Locale |
getSuitableLocale(java.lang.String countryCode)
If countryCode is null, return the first locale available on the phone.
|
public CountryCodeHelper(@NonNull
android.content.res.Resources resources,
com.yoti.mobile.android.common.ui.components.utils.IDemonymProvider demonymProvider)
@NonNull
public java.util.Locale getSuitableLocale(@Nullable
java.lang.String countryCode)
Locale.getDefault() and if this
returns only a language and no country, will use Configuration.getLocales() and try
to find the first match for the returned language above.countryCode - - country pre selected, can be null in which case the above behaviour will
be triggeredpublic java.util.List<Country> getCountriesForDeviceSupportedPhoneCode()
public Country getCountryForCode(@NonNull java.lang.String countryCodeIso2OrIso3)
protected abstract java.util.Locale[] getAvailableLocales()
Locale.getAvailableLocales()