Questions tagged [staggeredgridlayout]
99 questions
45
votes
4 answers
Android - Difference between Gridlayout and Staggered Gridlayout
I am working in android material design api & want to display some data in grid format. I tried both GridLayout and StaggeredGridlayout and both look same. For general information, i want to ask what is the difference between Gridlayout and…

IBRAR AHMAD
- 599
- 1
- 5
- 13
39
votes
3 answers
Setting span size of single row in StaggeredGridLayoutManager
I have a staggered grid that has 2 columns. This is working. What I want is at position 0 for the row to span across the 2 columns. I have done this before quite easily using GridLayoutManger as so:
…

Daniel Julio
- 1,463
- 3
- 14
- 23
28
votes
8 answers
StaggeredGridLayoutManager and moving items
I have created a very simple project, displaying 28 images with StaggeredGridLayoutManager by recyclerview. but as I scroll the recyclerview it moves items for example from left to right or swap the column of left and right.
codes:
import…

mmlooloo
- 18,937
- 5
- 45
- 64
24
votes
4 answers
How to implement Endless scrolling using StaggeredLayoutManager
I already tried to implement the endless scrolling for LinearLayoutManager and it is successful and tried to copy the LinearLayoutManager implementation to StaggeredGridLayoutManager but it doesn't work.
I just want to get the firstVisibleItem.
in…

Fran Ceriu
- 261
- 2
- 5
23
votes
2 answers
How to determine column position in staggered grid layout manager
I’m using a staggered recycler view layout for a list of photos. I want the spacing on the sides to be zero while still having space between the two columns. I’m using an item decoration sub class to get the spacing seen in the attached photo. I…

Richmond Watkins
- 1,342
- 9
- 17
21
votes
2 answers
RecyclerView onCreateViewHolder Return Type Incompatibility With Multiple Custom ViewHolders
I'm trying to use multiple ViewHolders in a RecyclerView in order to swap these views out at run time. I have created two classes which extend RecyclerView.ViewHolder:
MenuItemViewHolder
public class MenuItemViewHolder extends…

avgrammer
- 409
- 5
- 13
20
votes
9 answers
How to avoid double space between items when using RecyclerView with StaggeredGridLayoutManager?
I'm using RecyclerView with StaggeredGridLayoutManager to make a two-column list. But how to set a right margin between left column and right column. I have used this code to make right margin from top, but how to solve double space between to…

outofmemory
- 231
- 1
- 2
- 6
19
votes
1 answer
Dynamically Setting a Fixed Height for a Staggered Grid View
I'm trying to take a RecyclerView with a StaggeredGridLayout and make it a fixed height by having it measure the views and set the height dynamically. I'm overriding the onMeasure(), but it does not always seem to measure correctly. I'd say it works…

Peter Chappy
- 1,165
- 4
- 22
- 41
19
votes
3 answers
Variable number of columns in GridLayoutManager
I wanted to display variable number of columns in a row of GridLayoutManager while using RecyclerView. The number of columns to be displayed depends on the size of the column's TextView.
I don't know the column width as the text is being dynamically…

sg_dev
- 328
- 3
- 10
18
votes
4 answers
StaggeredGridLayoutManager reorders items
My items has different layouts and sometimes I create a gap or gaps on top of RecyclerView by dragging items in layout. When I scroll back to the top of RecyclerView some items are reordered and gaps get filled by them.
Behavior is captured…

Michal Zhradnk Nono3551
- 1,694
- 18
- 25
17
votes
2 answers
Spacing Issue while creating bus layout in recycler view Gridlayout manager
I'm using recycler view with GirdLayout Manager for creating bus layout. My problem is with spacing, I'm populating data according to row column.
This is how I'm getting layout:
This is how I want my layout to be:
I want the item at row 3 and…

Rohit Raich
- 492
- 4
- 15
13
votes
3 answers
StaggeredGridLayoutManager calculateCachedStart() IndexOutOfBoundsException
Hi I got error report from Fabric on my apps -> IndexOutOfBoundsException on StaggeredGridLayoutManager calculateCachedStart() method
There is many usage StaggeredGridLayoutManager on my apps.
Any idea to fix this error or trace which one in my apps…

Eric Wijaya
- 291
- 3
- 12
10
votes
4 answers
android:staggergridlayout while moving up shuffles
I am using staggered grid layout. the following is the code:
StaggeredGridLayoutManager glm= new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
glm.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);
I am using…

Santhosh
- 9,965
- 20
- 103
- 243
9
votes
5 answers
RecyclerView with StaggeredGridLayoutManager with images loading from Glide
I am having a problem showing RecyclerView with StaggeredGridLayoutManager whose item contain an imageview and the image is loaded in imageview using glide.
The problem i am facing is that after images getting loaded they are not staggered and are…

Passiondroid
- 1,573
- 1
- 16
- 28
8
votes
1 answer
How to set staggered grid span count to use available screen width?
I'm using vertical StaggeredGridLayoutManager to display some thumbnails. Each row contains a cardview with 1 inch width and 150dp height. My question is How can i set the staggered grid span count to use available physical width of the…

Sujith S Manjavana
- 1,417
- 6
- 33
- 60