-
-
Notifications
You must be signed in to change notification settings - Fork 509
Country Preference
-
Countries of preference will be listed at the top in selection dialog. It is helpful when the target audience is from a set of countries.
-
The library has a list of countries in alphabetical order. It searches for the country in same order. But preferred country/countries have higher priority than rest.
-
When more than one countries have the same code. For example, Canada, Puerto Rico and the US have +1.
-
If US is set in country preference, order for search will be (1)US-(2)Canada-(3)Puerto Rico, so it will pick the US for +1.
-
Any number of countries can be set in preference.
-
-
Add app:ccp_countryPreference="US,IN,NZ" (replace "US,IN,NZ" with your preference) to xml layout. Refer List of countries for name codes.
<com.hbb20.CountryCodePicker android:id="@+id/ccp" android:layout_width="wrap_content" android:layout_height="wrap_content" app:ccp_countryPreference="US,IN,NZ" />
-
- Use
setCountryPreference()
method.
-
-
This is how it will be shown in dialog.
-
- How to Integrate into your project
- Full Number Support
- Use as a Country Selector
- Auto detect country
- Auto detect language
- Remember last selection
- Country Preference
- Custom Mater List
- Exclude Countries
- Example phonenumber as hint
- Multi Language Support
- Default Country
- Country Selection Listener
- Dialog events listener
- CCP Theme Customization
- CCP Dialog Theme Customization
- Custom TypeFace
- Read Selected Country
- XML Properties
- Update Guide to v2
- Guide to Add New Language Support
- Guide to add New Country
- Change contry names for local project
- Handle CCP ClickListener Manually
- Custom Dialog Title/Hint/Empty Result ACK
- Flag Emoji Support (BETA)
- Change Log