首先来看一下瀑布流效果:
加载的数据根据自己需求自己定义。
来说一下具体实现:
private RecyclerView rlv;
private FlashApapter mAdapter;
//设置layoutManager
StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
//解决item跳动
manager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);
rlv.setLayoutManager(manager);
mAdapter = new FlashApapter (this,datas);
rlv.setAdapter(mAdapter);
下面看下FlashAdapter的具体实现:
public class FlashAdapter extends RecyclerView.Adapter<FlashAdapter.MyHolder> {
private Context context;
private List<Vide