- 授权协议: GPL
- 开发语言: Java
- 操作系统: Android
- 软件首页: http://git.oschina.net/cheln/BeanAdapter
- 软件文档: http://git.oschina.net/cheln/BeanAdapter/blob/master/README.md?dir=0&filepath=README.md&oid=eed0a4e3d16b02ebc9596752e7aff320f6849f60&sha=f4d1fad1a1933264bab603b6f8b871f357c90b42
软件介绍
BeanAdapter
BeanAdapter 是以List<Object> 为适配来源的adapter。List<Object>对adapter解决自定义对象的线性填充。
demo:
List trips = new ArrayList(); trips.add(trip1); trips.add(trip2); trips.add(trip3); BeanAdapter beanAdapter = new BeanAdapter()
//准备对应的object 字段 .buildNames("name","desc","positionRef","shareSuggestion","district","url") //准备和上面字段对应的填充id .buildViewId(R.id.name,R.id.desc,R.id.positionref,R.id.sharesuggestion,R.id.district,R.id.image) //完成配对,注意字段不要拼错,然后设置id群所在的item布局 .buildItemLayout(R.layout.item_layout) //最后一步配置view和value 在内部配对的converter,保证值解入view,可自定义设定 .buildConverter(new DefaultValueViewConverter()).build(trips); adapterView.setAdapter(beanAdapter);