2

So i have to do one layout like on the image, i need to do some scroll list horizontal but with different image size height. It works perfectly with the staggered layout but only at vertical.

This is how i am initiating the adapter:

StaggeredGridLayoutManager mLayoutManager = new StaggeredGridLayoutManager(2, LinearLayoutManager.HORIZONTAL);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setHasFixedSize(true);
mAdapter = new ColorAdapter(this, list);
mRecyclerView.setAdapter(mAdapter);

The adapter is inflating 2 xml with different types, does anyone know how to do that with the staggeredlayoutmanager?

Thank you!!

Staggered layout horizontal

4

0 回答 0