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

County list not available #418

Closed brcbydr closed 4 years ago

brcbydr commented 4 years ago

Hi all,

Thanks for that great library. I have implemented easily but there is no county list. So I have added raw xml's and tried again. Still not working. Please let me know what I am missing? I am using conductor btw.

Ekran Resmi 2020-07-10 07 34 19

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

            <com.hbb20.CountryCodePicker
                android:id="@+id/ccp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:ccp_showPhoneCode="true"
                app:ccp_autoFormatNumber="true"
                app:ccp_autoDetectLanguage="false" />

            <EditText
                android:id="@+id/edit_text_code"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:editable="false"
                android:hint="phone"
                android:inputType="phone"
                android:singleLine="true" />

        </LinearLayout>`

Conductor controller - OnCreateView -> view.ccp.registerCarrierNumberEditText(view.edit_text_code)

hbb20 commented 4 years ago

Sorry to hear that. Let me reiterate the problem so we can make sure I understood the problem correctly.

You added dependency and added CCP view in XML. When you run the app and click on CCP, dialog opens but you don't see any country in the list. To try a solution you added translation files to your local project.

Ideally it should work out of the box. I tried this XML configuration and that worked.

Do you see any error in logcat?

Try by removing all other attributes: app:ccp_showPhoneCode="true" app:ccp_autoFormatNumber="true" app:ccp_autoDetectLanguage="false"

If that doesn't work, I would like to inspect the project. If you can not share the project, I will be happy to look at a sample project where you can reproduce it.

Thank you, Harsh Bhakta

On Thu, Jul 9, 2020 at 22:40 brcbydr notifications@github.com wrote:

Hi all,

Thanks for that great library. I have implemented easily but there is no county list. So I have added raw xml's and tried again. Still not working. Please let me know what I am missing? I am using conductor btw.

[image: Ekran Resmi 2020-07-10 07 34 19] https://user-images.githubusercontent.com/64602954/87116998-06912780-c280-11ea-8174-ed47854922ed.png

<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical"> <com.hbb20.CountryCodePicker android:id="@+id/ccp" android:layout_width="wrap_content" android:layout_height="wrap_content" app:ccp_showPhoneCode="true" app:ccp_autoFormatNumber="true" app:ccp_autoDetectLanguage="false" /> <EditText android:id="@+id/edit_text_code" android:layout_width="match_parent" android:layout_height="wrap_content" android:editable="false" android:hint="phone" android:inputType="phone" android:singleLine="true" />

Conductor controller - OnCreateView -> view.ccp.registerCarrierNumberEditText(view.edit_text_code)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32B54DWWP2WG23POR4DR22LTLANCNFSM4OWHGODA .

brcbydr commented 4 years ago

Thanks for the quick support @hbb20 .

Yeap you understand the problem correctly.

Unfortunately, when I try it in main activity in the same way I saw that it is working :( So it is about Conductor support :( The conductor library is that: https://github.com/bluelinelabs/Conductor

What do you suggest? What do you think why behaves different for activity and controller?

Thanks in advance!

brcbydr commented 4 years ago

BTW, logcat logs are like below:

D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey V/CCP: updateFormattingTextWatcher: EditText not registered CCP_last_selection Accessing hidden field Landroid/widget/TextView;->mCursorDrawableRes:I (greylist-max-p, reflection, denied) D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey D/EGL_emulation: eglMakeCurrent: 0xe7aab9e0: ver 3 0 (tinfo 0xb6dc1630) D/EGL_emulation: eglMakeCurrent: 0xe7aab9e0: ver 3 0 (tinfo 0xb6dc1630)

I think there is no error, just can't display the country list?

hbb20 commented 4 years ago

Can you please create and share a sample project?

On Fri, Jul 10, 2020 at 02:56 brcbydr notifications@github.com wrote:

BTW, logcat logs are like below:

D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey V/CCP: updateFormattingTextWatcher: EditText not registered CCP_last_selection Accessing hidden field Landroid/widget/TextView;->mCursorDrawableRes:I (greylist-max-p, reflection, denied) D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey D/Class Country: Country->US:1:United States D/Class Country: Country->TR:90:Turkey D/EGL_emulation: eglMakeCurrent: 0xe7aab9e0: ver 3 0 (tinfo 0xb6dc1630) D/EGL_emulation: eglMakeCurrent: 0xe7aab9e0: ver 3 0 (tinfo 0xb6dc1630)

I think there is no error, just can't display the country list?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/418#issuecomment-656567031, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32HMUFOAAKLHDBOOJFTR23JTZANCNFSM4OWHGODA .

brcbydr commented 4 years ago

Sure @hbb20 ,

My sample app is ready: https://drive.google.com/drive/folders/18bTgmXVkbIQ33zDfDqdPANggLsUoI-yE?usp=sharing
I got the problem when I creating sample. It is not about Conductor, AppTheme - background image caused the problem. If you set background image to your AppTheme you can see it.

Thanks again!

hbb20 commented 4 years ago

Right. When theme is applied, it tried to put background (png image) on all elements and since it's static PNG it disturbs aspect ratio of view.

If you just want to show lightBg as background of screen only, then you can put an imageview in mainactivity like image and it should set it like background like this image

and then CCP (and all other rows) should be normal: image