基于 List 的适配器 BeanAdapter

码农软件 · 软件分类 · Java开发工具 · 2019-11-06 19:14:38

软件介绍

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);


本文地址:https://www.codercto.com/soft/d/18417.html

The Dream Machine

The Dream Machine

M. Mitchell Waldrop / Penguin Books / 2002-8 / USD 16.00

While most people may not be familiar with the name J. C. R. Licklider, he was the guiding spirit behind the greatest revolution of the modern era. At a time when most computers were big, ponderous ma......一起来看看 《The Dream Machine》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具