hbb20 / AndroidCountryPicker

Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.
MIT License
102 stars 29 forks source link

Country flag #27

Closed YSDC closed 3 years ago

YSDC commented 3 years ago

Hello, I like your library, and I want to use it, but I struggle on how to display a different flag than R.drawable.ic_flag_black.

I tried to look on how to get the emoji flag, but the issue is also that the getFlag(alpha2Code: String) expect an Int and therefore I don't know how to return the correct flag based on the user selection..

any help is welcome.

github-actions[bot] commented 3 years ago

I will look into this as soon as I get some time. If it's critical, please contact harshbbhakta@gmail.com

hbb20 commented 3 years ago

Emoji flags are default flags which are in-built. Nothing need to be changed. The custom flag provider is the if someone wants to provide flag drawable and that int is drawable res id.

If emoji flag is not coming up by default, show me the code and will figure it out.

On Fri, Jan 29, 2021 at 04:54 github-actions[bot] notifications@github.com wrote:

I will look into this as soon as I get some time. If it's critical, please contact harshbbhakta@gmail.com

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hbb20/AndroidCountryPicker/issues/27#issuecomment-769761349, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32BMRK475AERQANQEU3S4KOZFANCNFSM4WYXUACQ .

YSDC commented 3 years ago

Thank you for your quick answer. I looked at your sample with the "dropdown" to select the country, and I try to understand how can I display the emoji country flag instead of the default black flag (if you know what I mean.

hbb20 commented 3 years ago

Aah. I see.. I was testing if I provide a custom flag then custom flag will override the emoji flag. Try to remove that override in kotlin flow and it should be back to emoji flag.

Simply remove line 29-32 of MainActivity.kt and re-run.

On Fri, Jan 29, 2021 at 07:09 YSDC notifications@github.com wrote:

Thank you for your quick answer. I looked at your sample with the "dropdown" to select the country, and I try to understand how can I display the emoji country flag instead of the default black flag (if you know what I mean.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hbb20/AndroidCountryPicker/issues/27#issuecomment-769826619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32DRPQFLJOAIYEGRVQTS4K6RVANCNFSM4WYXUACQ .

hbb20 commented 3 years ago

*Line 29-34

On Fri, Jan 29, 2021 at 07:15 Harsh Bhakta harshbbhakta@gmail.com wrote:

Aah. I see.. I was testing if I provide a custom flag then custom flag will override the emoji flag. Try to remove that override in kotlin flow and it should be back to emoji flag.

Simply remove line 29-32 of MainActivity.kt and re-run.

On Fri, Jan 29, 2021 at 07:09 YSDC notifications@github.com wrote:

Thank you for your quick answer. I looked at your sample with the "dropdown" to select the country, and I try to understand how can I display the emoji country flag instead of the default black flag (if you know what I mean.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hbb20/AndroidCountryPicker/issues/27#issuecomment-769826619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32DRPQFLJOAIYEGRVQTS4K6RVANCNFSM4WYXUACQ .