CountryCodePicker

CountryCodePicker is an interface that provides the different utilities for the country code picker.

Properties

Link copied to clipboard
abstract val countryCode: String

Returns the country code e.g KE.

Link copied to clipboard
abstract val countryList: List<Country>

Returns the list of countries to be displayed in the country code picker dialog.

Link copied to clipboard
abstract val phoneNumber: String

Returns the phone number.

Link copied to clipboard
abstract val showCountryCode: Boolean

Shows the country code in the text field if true.

Link copied to clipboard
abstract val showCountryFlag: Boolean

Shows the country flag in the text field if true.

Functions

Link copied to clipboard
abstract fun getCountryName(): String

Returns the country name. i.e Kenya.

Link copied to clipboard
abstract fun getCountryPhoneCode(): String

Returns the phone number code of the country with a prefix. e.g +254.

Link copied to clipboard

Returns the phone number code of the country without a prefix. e.g 254.

Link copied to clipboard
abstract fun getFullPhoneNumber(): String

Returns the full phone number with the prefix. e.g +254712345678.

Link copied to clipboard

Returns the full phone number without the prefix. e.g 254712345678.

Link copied to clipboard

Returns fully formatted phone number.

Link copied to clipboard

Returns the phone number without the prefix. e.g 712345678.

Link copied to clipboard
abstract fun isPhoneNumberValid(phoneNumber: String = getFullPhoneNumber()): Boolean

Returns true if the phone number is valid.

Link copied to clipboard
abstract fun setCode(countryCode: String)

Sets the country code.

Link copied to clipboard
abstract fun setPhoneNo(phoneNumber: String)

Sets the phone number.