https://github.com/alibaba/vlayout/
源碼使用 :
finalRecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_view); //recycleview
final VirtualLayoutManager layoutManager =new VirtualLayoutManager(this); //關(guān)鍵的 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); //最后將各個條目的適配器添加到管理適配器中