I am using RecyclerView
with StaggeredGridLayoutManager
.
I want this StaggeredGridLayoutManager
or whichever LayoutManager
occupy empty areas if there is. For instance if I set the spanCount=3
it must occupy all screen width even I have 2 items or 1 items. In StaggeredGridLayoutManager
I can full span single row by : setFullSpan(true);
but can't span 2 items for only one row.
My code for RecyclerView
:
StaggeredGridLayoutManager sglm= new StaggeredGridLayoutManager(spanCount,StaggeredGridLayoutManager.VERTICAL);
sglm.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
I tried AsymmetricGridView and twoway-view but there is always an empty area
I collect some screenshots of Facebook App :
And here is the Google Keep App as you can see the row height is fixed for every row but the width of items is flexible and I've never seen any empty area with Google Keep:
And when I am using it there is always an empty area, as you can see the black part of image is empty. I want the RecyclerView
should occupy that area by extending my rows like in Google Keep app:
I visited this page : android-how-to-create-a-facebook-like-images-gallery-grid but it didn't helped me.
Here is the another page I visited : grid-of-images-like-facebook-for-android
Is there anyone uses RecyclerView
or any View
like that?
Can someone suggest me any way or any idea or guide me to where I must start?