{"id":13609901,"url":"https://github.com/hbb20/AndroidCountryPicker","last_synced_at":"2025-04-12T22:32:10.158Z","repository":{"id":40308029,"uuid":"209688939","full_name":"hbb20/AndroidCountryPicker","owner":"hbb20","description":"Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.","archived":false,"fork":false,"pushed_at":"2024-06-04T14:56:17.000Z","size":4172,"stargazers_count":103,"open_issues_count":8,"forks_count":30,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-08T04:51:20.310Z","etag":null,"topics":["android","android-library","country-flags","country-information","country-picker","country-selection","country-selector","country-spinner","currency-picker","kotlin","library","lightweight","multilanguage-support","picker"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hbb20.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"hbb20"}},"created_at":"2019-09-20T02:32:07.000Z","updated_at":"2025-02-28T21:49:38.000Z","dependencies_parsed_at":"2023-11-18T16:27:21.991Z","dependency_job_id":"2ee1d9e0-1419-41a1-832c-3fa9103fff2e","html_url":"https://github.com/hbb20/AndroidCountryPicker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbb20%2FAndroidCountryPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbb20%2FAndroidCountryPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbb20%2FAndroidCountryPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbb20%2FAndroidCountryPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbb20","download_url":"https://codeload.github.com/hbb20/AndroidCountryPicker/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248640861,"owners_count":21138106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","country-flags","country-information","country-picker","country-selection","country-selector","country-spinner","currency-picker","kotlin","library","lightweight","multilanguage-support","picker"],"created_at":"2024-08-01T19:01:39.099Z","updated_at":"2025-04-12T22:32:08.976Z","avatar_url":"https://github.com/hbb20.png","language":"Kotlin","funding_links":["https://github.com/sponsors/hbb20"],"categories":["Kotlin"],"sub_categories":[],"readme":"![visitors](https://visitor-badge.laobi.icu/badge?page_id=AndroidCountryPicker.readme)\n[![Add](https://maven-badges.herokuapp.com/maven-central/com.hbb20/android-country-picker/badge.svg?style={style}) ](https://github.com/hbb20/AndroidCountryPicker/blob/develop/CHANGELOG.md) \n\n\n\u003cimg height=500 src=\"https://user-images.githubusercontent.com/4918760/90301130-32916100-de5b-11ea-8238-3f1e03ef325c.png\"/\u003e\n\n\n| Country Picker View | Country Picker Dialog |\n| --- | ----------- |\n| \u003cimg src=\"https://user-images.githubusercontent.com/4918760/133714158-7f5f7d49-def9-483c-bc3b-8302965b7a0b.gif\" width=\"200\"\u003e | \u003cimg src=\"https://user-images.githubusercontent.com/4918760/154889351-687907cb-ee9b-4e90-b276-afc157459f13.gif\" width=\"200\"\u003e |\n\n### 1. Add dependency\n   - ```groovy\n         dependencies {\n           implementation 'com.hbb20:android-country-picker:X.Y.Z'\n          }\n      ```\n   - For latest version, [![Add](https://maven-badges.herokuapp.com/maven-central/com.hbb20/android-country-picker/badge.svg?style={style}) ](https://github.com/hbb20/AndroidCountryPicker/blob/develop/CHANGELOG.md)\n\n\n### 2. Decide your use-case\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDefault Country Picker View\u003c/b\u003e\u003c/summary\u003e\ni. add following to your XML layout    \n\n```xml\n   \u003ccom.hbb20.CountryPickerView\n   android:id=\"@+id/countryPicker\"\n   android:layout_width=\"wrap_content\"\n   android:layout_height=\"wrap_content\" /\u003e\n```\n    \nii. modify view / dialog / list config in activity or fragment\n```kotlin\nprivate fun setupCountryPickerView() {\n        val countryPicker = findViewById\u003cCountryPickerView\u003e(R.id.countryPicker)\n\n        // Modify CPViewConfig if you need. Access cpViewConfig through `cpViewHelper`\n        countryPicker.cpViewHelper.cpViewConfig.viewTextGenerator = { cpCountry: CPCountry -\u003e\n            \"${cpCountry.name} (${cpCountry.alpha2})\"\n        }\n        // make sure to refresh view once view configuration is changed\n        countryPicker.cpViewHelper.refreshView()\n\n        // Modify CPDialogConfig if you need. Access cpDialogConfig through `countryPicker.cpViewHelper`\n        // countryPicker.cpViewHelper.cpDialogConfig.\n\n        // Modify CPListConfig if you need. Access cpListConfig through `countryPicker.cpViewHelper`\n        // countryPicker.cpViewHelper.cpListConfig.\n\n        // Modify CPRowConfig if you need. Access cpRowConfig through `countryPicker.cpViewHelper`\n        // countryPicker.cpViewHelper.cpRowConfig.\n    }\n```\n\nii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-Picker-View) about Country Picker View and available configuration \n      \n\u003c/details\u003e\n    \n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCustom Country Picker View\u003c/b\u003e\u003c/summary\u003e\n\ni. Read how to create your [Custom Country Picker View](https://github.com/hbb20/AndroidCountryPicker/wiki/Custom-Country-Picker-View)\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eLaunch Country Picker Dialog\u003c/b\u003e\u003c/summary\u003e\ni. add following to your Activity/Fragment    \n\n```kotlin\n   context.launchCountryPickerDialog { selectedCountry: CPCountry? -\u003e\n     // your code to handle selected country\n   }\n```\n\nii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-Picker-Dialog) about CountryPicker Dialog and available configuration \n\u003c/details\u003e\n    \n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eLoad countries in RecyclerView\u003c/b\u003e\u003c/summary\u003e\ni. add following to your Activity/Fragment    \n\n```kotlin\n   recyclerView.loadCountries { selectedCountry: CPCountry -\u003e \n     // your code to handle selected country\n   }\n```\n\nii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-List-(RecyclerView)) about Country List and available configuration \n \n\u003c/details\u003e\n\n### Credits\n- [ip2Location](https://www.ip2location.com/) for country data\n- Airbnb for [Epoxy Recycler View](https://github.com/airbnb/epoxy) library\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbb20%2FAndroidCountryPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbb20%2FAndroidCountryPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbb20%2FAndroidCountryPicker/lists"}