If you are looking for an android library for Country Selector or Country Spinner or Country Phone Code selector, this is the perfect place for you.
Country Code Picker (CCP) or is an android library which provides an easy way to search and select country or country phone code for the telephone number.
-
Give a professional touch to your well designed form like login screen, sign up screen, edit profile screen with CCP. When used as phone code picker, it helps by removing confusion about how to add phone number and making view more understandable.
-
With CCP you can get following views easily without boilerplate code. (Left: Phone code selector. Right: Country Selector)
-
Tapping on CCP will open a dialog to search and select country (Left: Phone code selector. Right: Country Selector) -
Add this to your gradle file and sync
dependencies {
implementation 'com.hbb20:ccp:2.1.9'
}
What's new?
- Swedish language support
- Feature to exclude specific countries from the list. Wiki Page
- Option to remember last selection.
- If you are using version lower than 2.0.0 then please read update guide before upgrading to v2.0.0.*
If you prefer experience along with explanations, an demo android app is available that demonstrates all the features of this library. Click below button to download from Playstore.
- Super easy to integrate
- Full Number Support
- Auto-Formatting
- Number Validation
- Validity Change Listener
- Read / Load full number
- Use as Country Selector / Country Spinner
- Country preference
- Custom master list
- Country Selection Change Listener
- Multi-language support
- Customizable CCP theme and Dialog Theme
- Auto detect Country
- Auto detect Language
- Remembers last selection
- Fast Scroller
To check all xml properties available for CCP and CCP Selection ppDialog, please visit the wiki page.
- Adds Swedish language support (Pull request by Tobias Hillén)
- Adds Kosovo Country (Pull request by Aleksei Kliuev)
- Adds Guadeloupe Countries Issue#170
- Understands difference between Isle of Man country and UK numbers. Issue#168
- Feature to remove country name code from CCP Dialog Issue#159
- Adds ccp_hintExampleNumberFormat to address cases like Issue#154
- Handles national trunk prefixes correctly. Issue#149
- Feature to add selected country's example number as hint of carrier number edit text. Wiki Page
- Corrected dimension of French Guiana flag (Pull request by Gautier MECHLING)
- Feature to exclude specific countries from the list. Wiki Page
- Adds Punjabi language support Pull Request By Dhruv Bhakta
- Corrected Arabic translation by Ahmed Wahdan
- Country name textView, Flag imageView, Arrow imageView are now publicly accessible through getter-setters.
- Opens Country class (Renamed to "CCPCountry" to avoid naming confusion) (issue#136)
- Fixes preview in Android Studio 3
- Auto detects country while typing based on area code (for countries with code "+1") (issue#140)
- Cursor color follows ccpDialog_searchEditTextTint color (issue#131)
- Possible fix for crash (issue#67)
For earlier versions, check full log.
- Fast Scroller library by Future Minds
- Optimized Android port of libphonenumber by Michael Rozumyanskiy
- Hebrew translation by David Brownstone
- Chinese translation by KENNETH2008
- Indonesia translation by Maulana Firdaus
- Spanish translation by Armando Gomez
- Turkish translation by Ugurcan Yildirim
- Ukrainian language support by VyacheslavMartynenko
- Italian language support by Fabrizio Gueli
- Korean language support by kduhyun
- Portuguese translation corrections by Elifázio Bernardes da Silva
- Flag border color option by Maulana Firdaus
- Dutch language support by Bozintan Iuliana
- Punjabi language support by Dhruv Bhakta
- Arabic translation corrections by Ahmed Wahdan
- Swedish language support by Tobias Hillén
- Addition of Kosovo Country by Aleksei Kliuev
- To add a new country, follow the guide for add new country.
- To add a new Language support, follow the guide for add new language support.
Copyright (C) 2016 Harsh Bhakta
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.