Package-level declarations

The canonical Country model, PhoneNumberValue, UiText, and the small enums that describe selection mode, search fields, supporting content and regions. Also the conversions between the canonical model and the legacy com.ezzy.ccp.model types.

The canonical Country model, PhoneNumberValue, UiText, and the small enums that describe selection mode, search fields, supporting content and regions. Also the conversions between the canonical model and the legacy com.ezzy.ccp.model types.

Types

Link copied to clipboard
data class Country(val iso2Code: String, val iso3Code: String, val displayName: String, val dialCode: String, val flag: String?, val region: CountryRegion, val alternativeNames: List<String> = emptyList())

The canonical country representation for the whole library.

Link copied to clipboard
data class CountryMatch(val country: Country, val matchedField: CountrySearchField? = null, val highlightStart: Int = -1, val highlightLength: Int = 0, val rank: Int = Int.MAX_VALUE)

A country that matched a search query, plus the information needed to rank and highlight it.

Link copied to clipboard

Geographic region a Country belongs to, following the UN M49 top-level groupings used by the country dataset. These are the regions offered by the sheet's quick filter chips.

Link copied to clipboard

Whether the picker commits a selection immediately or stages it behind a confirm action.

Link copied to clipboard

The metadata line a Country selector or row shows under the country name — e.g. "DE · +49".

Link copied to clipboard

Whether a field-like component (the phone number field, a country selector) shows a visible label.

Link copied to clipboard

What kind of line a phone number is, as classified by libphonenumber's per-region metadata.

Link copied to clipboard

Machine-readable validation outcome, kept separate from the user-facing message so hosts can branch on the reason without string matching.

Link copied to clipboard
data class PhoneNumberValue(val country: Country, val nationalNumber: String, val formattedNationalNumber: String, val internationalNumber: String, val e164Number: String?, val isPossible: Boolean, val isValid: Boolean, val validity: PhoneNumberValidity = PhoneNumberValidity.Empty, val numberType: PhoneNumberType? = null)

Everything a caller needs to know about the phone number currently in the field.

Link copied to clipboard

What the phone country-code prefix shows before the divider — e.g. 🇰🇪 +254 is FlagAndDialCode.

Link copied to clipboard
sealed interface UiText

A string that has not been resolved yet — either a literal the host supplied, or a resource the library will resolve against the current configuration.

Functions

Link copied to clipboard
fun UiText.Companion.plural(@PluralsRes id: Int, count: Int, vararg args: Any): UiText

References an Android plurals resource; see UiText.Companion.plural for how args default.

Link copied to clipboard

Resolves this UiText against the current composition's resources.

Link copied to clipboard

Resolves a country from an ISO code or a country name, the way the legacy setCountry parameter worked.

Link copied to clipboard
fun UiText.Companion.resource(@StringRes id: Int, vararg args: Any): UiText

References an Android string resource — for hosts whose strings live in res/values:

Link copied to clipboard

Resolves a legacy LegacyCountry to its canonical counterpart.

Link copied to clipboard

Projects a canonical Country into the legacy model.

Link copied to clipboard

Projects a PhoneNumberValue into the legacy Phone snapshot.

Link copied to clipboard

Projects a canonical Country into the legacy SelectedCountry used by Phone.