use of com.alibaba.android.vlayout.DelegateAdapter.Adapter in project vlayout by alibaba.
the class DebugActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_view);
VirtualLayoutManager virtualLayoutManager = new VirtualLayoutManager(this);
DelegateAdapter delegateAdapter = new DelegateAdapter(virtualLayoutManager);
List<Adapter> adapterList = new ArrayList<>();
adapterList.add(new SubAdapter(new LinearLayoutHelper(20), 20));
adapterList.add(new SubAdapter(new StickyLayoutHelper(true), 1));
adapterList.add(new SubAdapter(new LinearLayoutHelper(20), 20));
adapterList.add(new SubAdapter(new GridLayoutHelper(4), 80));
// adapterList.add(new SubAdapter(new FixLayoutHelper(0, 0), 1));
adapterList.add(new SubAdapter(new FixLayoutHelper(TOP_RIGHT, 0, 0), 1));
delegateAdapter.addAdapters(adapterList);
recyclerView.setLayoutManager(virtualLayoutManager);
recyclerView.setAdapter(delegateAdapter);
}
Aggregations