hbb20 / CountryCodePickerProject

Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
Apache License 2.0
1.52k stars 506 forks source link

Fullnumber in carrier number EditText #324

Open tianzhuqiao opened 5 years ago

tianzhuqiao commented 5 years ago

Thanks for the great project. I know the carrier number EditText is designed for carrier number (without country code); however looks like sometime users may type in the full number (e.g. copied, or auto filled). In this case, ccp.isValidFullNumber will return false. Is there some good way to detect that and return valid full phone number?

Thanks

hbb20 commented 5 years ago

That's interesting... It shouldn't be giving true or try form a valid number out of possible valid number. But I started something like, if edittext gets number pasted with "+", it might detect and load country and remove country code from it leaving valid carrier number in editText. I will look into this. Any thoughts?

tianzhuqiao commented 5 years ago

Right, maybe we can do something like this (e.g., if the number is parsed successfully, then remove the country code from the number, and set the ccp accordingly if necessary; otherwise no change?).

Do you have plan to support this in future release?