Questions tagged [gridlayoutmanager]

A RecyclerView.LayoutManager implementations that lays out items in a grid.

A RecyclerView.LayoutManager implementations that lays out items in a grid. More info on the docs: https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.html

403 questions
12
votes
1 answer

notifyItemRangeChanged() causing crash RecyclerView Android

layout design: HorizontalScrollView-parent, holding RV[ RecyclerView=>(GridLayoutManager) (orientation verticle)] Which will basically do a two way scroll. This UI is built for TV. The focused row in this grid will show extra detail and other…
12
votes
3 answers

RecyclerView with GridLayoutManager and Picasso showing wrong image

Update #1 Added hasStableIds(true) and updated Picasso to version 2.5.2. It does not solve the issue. Reproduction: RecyclerView with GridLayoutManager (spanCount = 3). List items are CardViews with ImageView inside. When all the items does not fit…
gswierczynski
  • 3,813
  • 2
  • 21
  • 22
12
votes
2 answers

RecyclerView grid with different item sizes

I need to create a horizontal scrolling grid that can allocate items with different width and different height. StaggeredGridLayoutManager can handle different width but it won't let me have items with different height. Is there any LayoutManager…
Charlie-Blake
  • 10,832
  • 13
  • 55
  • 90
11
votes
1 answer

Centering items in a RecyclerView when it's implemented with GridLayoutManager

I have a RecyclerView implemented using the GridLayoutManager. Depending on how many items are in the data set, the spanCount is between 1-4. The item widths change depending on the spanCount. If the spancount is 4 or above, the spanCount is left at…
10
votes
2 answers

Apply offset to GridLayout items and preserve equal size among all items

I want to create a space between items in the grid. The items should all have equal width/height. What I've tried: Create a GridLayoutOffsetDecorator that applies an offset to all grid items: class GridLayoutOffsetDecorator(var offset: Int) :…
10
votes
2 answers

populate GridLayoutManager first by row and then by column

I'm having an issue while populating a recycler view with a GridLayoutManager. I need to fulfill the first row, and after this is complete, go to the second row. I did an algorithm that reorders the list so it's being shown properly and I can get…
Juan Giorello
  • 333
  • 2
  • 13
10
votes
1 answer

Android GridLayoutManager with both column and row span

I'm using GridLayoutManager(GLM) in my RecyclerView. In the RecyclerView, I will populate the CardViews, how can I set my GLM to render only one CardView in the whole screen ? If I set the span size as 1, it renders one CardView per row, not whole…
Kamalakannan J
  • 2,818
  • 3
  • 23
  • 51
9
votes
2 answers

GridLayoutManager with different column count per row

I'm trying to build a RecyclerView with a GridLayoutManager which has a variable column count per row, something like this: The sum of the width of all items in the same row will always be the screen width. I tried to re-organize the list of items,…
moyo
  • 1,312
  • 1
  • 13
  • 29
9
votes
2 answers

GridLayoutManager setSpanSizeLookup not working

I am using GridLayoutManager with 2 cells and for some cells I want span to be one so I tried using setSpanSizeLookup but its not working. I tried returning span count 1 for all positions but still two cells are appearing instead of one. Following…
9
votes
3 answers

RecyclerView with GridLayoutManager trying to solve wrap_content

I try to solve the following: using RecyclerView with GridLayoutManager with fixed cell-widths recyclerview resizing only to the necessary height (wrap_content) I try to use the following code, the problem is that it doesn't work, and I haven't…
Csabi
  • 807
  • 3
  • 8
  • 18
9
votes
2 answers

How to make first image larger in Gridlayout?

To be precise I want to achieve this. I am using recyclerview with GridLayoutManager. I also have made first item large using the following code lLayout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override …
rockfight
  • 1,916
  • 2
  • 20
  • 31
8
votes
1 answer

OnCreateViewHolder performance issue

I ran into a problem with a RecyclerView and I thought you guys can help me. So the problem is: Inflating the item view xml takes too much time. The layout is grid layout with 3 items in a row and each item has a complex UI look. So first I've used…
OmB
  • 366
  • 2
  • 13
8
votes
2 answers

Increase cell width in a RecyclerView with GridLayoutManager

I have a RecyclerView with a GridLayoutManager with spanCount=2 and a Vertical orientation. My items are correctly displayed as the image below: Now I need to add an animation that when a click on one of the items, let's say number "3", that item…
amp
  • 11,754
  • 18
  • 77
  • 133
8
votes
5 answers

Divide width between two columns in GridLayoutManager

I used GridLayoutManager as my layout manger for recycler view. mRecyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2)); the result is like below: but I want to divide width between two columns equally. how can I do that?
8
votes
1 answer

RecyclerView with GridLayoutManager and first element with different viewHolder

I need to create a recyclerView with a GridLayoutManager on two lines, and the first element to be bigger than the rest. The result should look like this: I managed to achieve this, but in an unconventional way. In my recyclerView adapter I use a…
1 2
3
26 27