The most important thing is RecyclerView settings

// set the cascade form, 2 to two
staggerRecycler.setLayoutManager (new new StaggeredGridLayoutManager (2, StaggeredGridLayoutManager.VERTICAL));

// set adapter
staggerRecycler.setAdapter (new RecyclerStaggeredAdapter (getContext () , staggeredData));
Well, we run it will produce scattered cascade effect of:

 

?? Well, it so far, several ?? RecyclerView common form layout gave tried again, in general, are very good, especially with? After CardView, show better results. But there is also a library design more beautiful control, there is a perfect match with RecyclerView is born, that is, pull down to refresh controls:? SwipeRefreshLayout, finally, let's continue to SwipeRefreshLayout added to the RecyclerView, see how it works, right?? .
---------------------

Guess you like

Origin www.cnblogs.com/hyhy904/p/11347017.html