美文网首页
阿里强大的 复杂布局 vlayout

阿里强大的 复杂布局 vlayout

作者: ping0505 | 来源:发表于2017-07-28 17:36 被阅读125次

https://github.com/alibaba/vlayout/

源码使用 :

finalRecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_view);   //recycleview 

final VirtualLayoutManager layoutManager =new VirtualLayoutManager(this);  //关键的 lanoutmanager  

final DelegateAdapter delegateAdapter = new DelegateAdapter(layoutManager, true);  //管理适配器  用来管理多个条目各自的adapter 

recyclerView.setAdapter(delegateAdapter);

final List<DelegateAdapter.Adapter> adapters = new LinkedList<>();  

 adapters.add(new SubAdapter(this, new LinearLayoutHelper(), 1) {
....

delegateAdapter.setAdapters(adapters); //最后将各个条目的适配器添加到管理适配器中 

源码分析:
http://www.itdadao.com/articles/c15a1366477p0.html

相关文章

网友评论

      本文标题:阿里强大的 复杂布局 vlayout

      本文链接:https://www.haomeiwen.com/subject/uisflxtx.html