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

Formatted Number don´t work in Android 7 #103

Closed Alejan93 closed 6 years ago

Alejan93 commented 7 years ago

Hi, I am using a phone with android 7, and when I type the phone number it doesn't get formatted, but when a I use a phone with a lower android version it works

hbb20 commented 7 years ago

Hey, that should not happen. Because it works well for my device running on Android 7 Nougat. Can you please show your gradle file? and what's your testing device?

osama-taha commented 7 years ago

same issue I see on Huawei Mate 9.0 - Android 7.0 I am using the latest library version 2.0.5

Alejan93 commented 7 years ago

I'm using Huawei p10 lite with Android 7

osama-taha commented 7 years ago

Here is my configurations:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical">

    <com.hbb20.CountryCodePicker
        android:id="@+id/country_code_picker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:ccpDialog_showPhoneCode="true"
        app:ccp_autoDetectCountry="true"
        app:ccp_autoDetectLanguage="true"
        app:ccp_autoFormatNumber="true"
        app:ccp_countryPreference="us"
        app:ccp_showPhoneCode="true" />

    <EditText
        android:id="@+id/phone_number_edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:editable="false"
        android:hint="@string/place_holder"
        android:inputType="phone"
        android:maxLines="1" />

</LinearLayout>

countryCodePicker.registerCarrierNumberEditText(phoneNumberEditText);

hbb20 commented 7 years ago

Is CCP's older version (Specifically 2.0.3) working for you people? Can you please check and report?

osama-taha commented 7 years ago

still happening even in v2.0.0

ma-altaiir commented 6 years ago

Hey all; Formatting not working properly, the hint suggested by the component do not take into acount any leading zero, however if you try with a leading zero then formatting will work, this is a confusing behaviour since as we are presented with an international code we directly enter a phone number withount a leading zero, if formatting source code is working based on digits count then you can correct it.

hbb20 commented 6 years ago

@Ma-Altaiir , please try version 2.2.0 and post back if the issue persists.