2016-06-12 13:29:17 +08:00
2016-03-16 22:54:58 +08:00
2016-03-08 20:06:56 +08:00
2015-10-24 21:55:27 +08:00
2016-06-12 13:29:17 +08:00
2016-03-08 20:06:56 +08:00
2015-12-16 21:08:36 +08:00
2016-03-10 18:08:38 +08:00
2016-05-20 10:24:19 +08:00
2015-10-24 21:55:27 +08:00
2015-10-24 21:55:27 +08:00
2016-03-14 10:30:38 +08:00
2016-03-14 10:30:38 +08:00
2016-03-08 20:06:56 +08:00

VirtualLayoutManager

中文文档

Project vlayout is a powerfull LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview.

Usage

Import Library

Please find the latest version in maven repository.

For gradle:

// gradle
compile 'com.alibaba.android:vlayout:1.2.0@aar'

Or in maven:

// pom.xml 
<dependency>
  <groupId>com.alibaba.android</groupId>
  <artifactId>vlayout</artifactId>
  <version>1.2.0</version>
  <type>aar</type>
</dependency>

Initialize LayoutManager

final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
final VirtualLayoutManager layoutManager = new VirtualLayoutManager(this);

recyclerView.setLayoutManager(layoutManager);

Set Adapters

  • You can use DelegateAdapter for as a root adapter to make combination of your own adapters. Just make it extend DelegateAdapter.Adapter and overrides onCreateLayoutHelper method.
DelegateAdapter delegateAdapter = new DelegateAdapter(layoutManager, hasStableItemType);
recycler.setAdapter(delegateAdapter);

// Then you can set sub- adapters

delegateAdapter.setAdapters(adapters);

// or
CustomAdapter adapter = new CustomAdapter(data, new GridLayoutHelper());
delegateAdapter.addAdapter(adapter);

S
Description
Project vlayout is a powerfull LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview.
Readme MIT 2.1 MiB
Languages
Java 100%