chihane / jdaddressselector Goto Github PK
View Code? Open in Web Editor NEW京东 Android 客户端样式的级联地址选择器
License: MIT License
京东 Android 客户端样式的级联地址选择器
License: MIT License
可以选择第一层,请求网络数据刷新第二层吗
10月16日往来邮件记录
Q: 我现在做的项目用到你写的京东收获地址,包括三级地址,你写的是四级地址联动,你能否帮我关了第四级地址联动,急用,谢谢.
A: 街道数据返回为空的时候就会直接触发回调,所以自己提供Provider,或者改写DefaultAddressProvider,让第四级数据在任何时候都返回null就可以了。
city.id 这里面的值查询不到城市啊
Could not find com.github.Raizlabs.DBFlow:dbflow:3.0.0-beta6.
Required by:
project :app > com.github.chihane:JDAddressSelector:1.1.4
如果 让BottomDialog设置成自定义的json数据
运行报:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/raizlabs/android/dbflow/sql/Query;
及 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.raizlabs.android.dbflow.sql.Query" on path: DexPathList[[dex fil...错误
看了下你项目DBFlow是用的3.0.0-beta6版,我就把他替换成3.0.0正式版了,然后就好了,由于我没有用过DBFlow,不知道是什么原因,看着有点像dex分包的原因,估计是我自己的问题
比如:
第一次我选中 Provinces;
下一步,我选city;
按理说,只有选择的未红色字体和勾选,但是其他没被选的也变成了红色字体。
例如京东APP中:编辑地址-所在地区 已经有数据了: 北京市 - 海淀区 - 某街道
这时再次点击编辑后弹出的框是默认选中已选的了。。。这个可以做吗?
我添加依赖之后报错:
Error:Execution failed for task ':myproject:processDebugManifest'. > Manifest merger failed with...
后来找到原因是我把android:allowBackup="false",我觉得这是个bug
Tab “请选择”,我怎么改成英文或则其他语言,你代码里是写死的
地址选择时,点击过快出现崩溃。the cotent of the adapter has changed but ListView did not receive a notication
报chihane.jdaddressselector.b.g is not registered with a Database. Did you forget the @table annotatio
你好,按照readme中尝试自定义数据,发现省份数据设置无效
经查证,是因为setAddressProvider方法并没有进行省份数据源刷新,已修正内容如下:
`public void setAddressProvider(AddressProvider addressProvider) {
this.addressProvider = addressProvider;
if (addressProvider == null) {
this.addressProvider = DEFAULT_ADDRESS_PROVIDER;
}
retrieveProvinces();//增加该行重新赋值
}`
个人再提个小建议,可以把回到接口拆分成多个回调方法 ,这样适应新更强。
感谢作者提供如此优秀的库,请问能否在点击省或者市的时候加上监听,比如我不想选到第三第四级城市就能确定,是否提供了这个功能呢
例如,我只想选择四川就OK,不想继续选择成都 这些下级市
您好,这个怎么去获取选中的地区
我想修改初始省市区怎么修改
看源码找了很久,没找到数据源是哪儿来的,只知道一触发BottomDialog就会生成一个数据库,但是不知道数据是从哪儿来的,请指点一下
比如只选择省份
使用的是自定义的数据源。点击城市列表一个item,然后就全选了
你好,我找了这样的地址选择器很久,写得很好,谢谢作者。
建议:
selectProvinces()
selectCitiesBy(int i)
selectCountiesBy(int i)
selectStreetsBy(int i)
这几个方法提供除了查询本地数据库的方法外,另外提供自定义的查询方法就更好了(我想查询服务器),目前我是下载工程到本地,然后倒入library,把上面的方法从private改为public,然后子类复写上面的方法实现自己要的查询的。
我是有一点少经验的开发者,如有错漏点,欢迎指教。再次感谢你的贡献,谢谢。
自定义数据源,接口返回后一直转圈 明明成功了.没有报错. 还有为什么id,province_id 全定义的int类型呢.心好累
自己试了下
-keep class chihane.jdaddressselector.**{*;}
-keep class com.raizlabs.android.**{*;}
使用的是本地Json文件数据源
//使用自定义数据源
selector.setAddressProvider(object : AddressProvider {
override fun provideProvinces(addressReceiver: AddressReceiver) {
addressReceiver.send(AddressUtil().getProvinces(this@AddSiteActivity))
}
override fun provideCitiesWith(provinceId: Int, addressReceiver: AddressReceiver<City>) {
addressReceiver.send(AddressUtil().getCity(provinceId, this@AddSiteActivity))
}
override fun provideCountiesWith(cityId: Int, addressReceiver: AddressReceiver<County>) {
addressReceiver.send(AddressUtil().getCounty(cityId, this@AddSiteActivity))
}
override fun provideStreetsWith(countyId: Int, addressReceiver: AddressReceiver<Street>) {
}
})
这样使用,点击省份不显示下一级
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.