I have a RecyclerView and I used StaggeredGridLayoutManager for its layout manager. Every item has different width and I don't know how wide is every item.
My code:
StaggeredGridLayoutManager stagedLayoutManager = new StaggeredGridLayoutManager(4, VERTICAL);
recyclerView.setLayoutManager(stagedLayoutManager);
The result is some thing looks like this:

But I want to have some thing looks like this one:
Please guid me how can I achieve this purpose? Thanks