# CityPicker **Repository Path**: actor20170211030627/CityPicker ## Basic Information - **Project Name**: CityPicker - **Description**: 中国城市选择器 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-01-08 - **Last Updated**: 2025-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CityPicker ## 中国城市选择器 ### 1.一个简单的城市选择器 数据来源: 中华人民共和国民政部 ### 2.Screenshot ### 3.Demo download apk or scan qrcode:
### 4.USE使用 //1.init in you application CityListLoader.getInstance().init(this); //2.use in activity CityPickerBottomDialog dialog = new CityPickerBottomDialog(this); dialog.setTitle("选择地址"); dialog.setDimAmount(0.5F);//default = 0.5 dialog.setOnSubmitClickListener(new CityPickerBottomDialog.OnSubmitClickListener() { @Override public void onSubmitClick(CityInfo province, CityInfo.CityListBeanX city, CityInfo.CityListBeanX.CityListBean district) { String address = String.format("省市区:%s-%s-%s", province.name, city.name, district.name); Log.e(TAG, "onSubmitClick: address=".concat(address)); toast(address); dialog.dismiss(); } }); dialog.show(); ## 5. 需要在自己项目中集成v7包和recyclerviewgson, 否则报错 implementation 'com.android.support:appcompat-v7:version xxx'
implementation 'com.android.support:recyclerview-v7:xxx'
//https://github.com/google/gson implementation ''com.google.code.gson:gson:xxx'
## 6.How to To get a Git project into your build: **Step 1.** Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
**Step 2.** Add the dependency, the last version: [![](https://jitpack.io/v/actor20170211030627/CityPicker.svg)](https://jitpack.io/#actor20170211030627/CityPicker) dependencies { implementation 'com.github.actor20170211030627:CityPicker:version' } ### 7.TODO
  1. 自定义item
  2. 自定义item条数
  3. 更新地址数据
  4. more...
### 8.Thanks: citypicker, 数据来源参考了这个项目, 感谢作者 ### 9.License [![License](https://img.shields.io/badge/license-Apache%202-green.svg)](https://www.apache.org/licenses/LICENSE-2.0)