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
8
votes
1 answer

Dynamically set the columnwidth in gridlayoutmanager

I am trying to do this using recycler view with gridlayoutmanager. GridLayoutmanager takes spancount. Here I want to update the view based on the width of the text in the recycler view items.
Ranjana Dangol
  • 1,319
  • 2
  • 13
  • 24
8
votes
3 answers

GridLayoutManager with custom divider

I am trying to add custom divider in RecyclerView with GridLayoutManager but not getting success, i have searched a lot and looked into below mention answer but it didn't help me link 1 link 2 link 3 I want to put black line in between each items of…
Ravi
  • 34,851
  • 21
  • 122
  • 183
8
votes
5 answers

Android: StaggeredGridLayoutManager scroll to top while initializing

I'm using StaggeredGridLayoutManager for my image gallery. I've set setReverseLayout(true), so that images get stacked from bottom. The problem I'm facing is that at initialization of app, the scroll points at bottom of gallery. I would want the…
Neo
  • 13,179
  • 18
  • 55
  • 80
7
votes
1 answer

RecyclerView + GridLayoutManager: Resizing items to fit the screen and preserve ratio

I'm trying to use RecyclerView and GridLayoutManager to display a list of items. Here are the criteria which I want to satisfy: Each row has a number of items specified by spanCount Each item takes up an equal portion of the screen and together…
mpontus
  • 2,143
  • 2
  • 19
  • 21
7
votes
2 answers

Avoid scrolling of first row and first column in recyclerview gridlayoutmanager

Created a two way scrollable gridlayout for a TV app view structure from layout file
DJphy
  • 1,292
  • 1
  • 17
  • 31
7
votes
0 answers

How remove spacing Horizontal GridLayoutManager recyclerview android

I use recyclerview with grid layoutmanager I don't add ItemDecoration GridLayoutManager gridLayoutManager = new GridLayoutManager(TestResultActivity.this, 4, GridLayoutManager.HORIZONTAL, false); …
6
votes
3 answers

RecyclerView with horizontal GridLayoutManager adjusts its height to largest row

I want to use RecyclerView with GridLayoutManager to achieve something like that: Here is GridLayoutManager with horizontal orientation and 2 rows. What's important for me here is that RecyclerView is set as wrap_content. So I tried to achieve my…
Nominalista
  • 4,632
  • 11
  • 43
  • 102
6
votes
1 answer

Get the column number where a view is on a GridLayoutManager

I have different types of items being rendered in a RecyclerView using a GridLayoutManager with dynamic column number. The problem is, I have an RecyclerView.ItemDecoration which is to be applied for let's say Type A items only. this…
6
votes
2 answers

Make GridLayoutManager VERTICAL orientation with horizontal scrolling

I need the RecyclerView Gridlayout Manager with horizontal scrollable behavior. It must add child views like it does when it has VERTICAL orientation (column wise index for e.g. (row 1, col 1) = index 0, (row 1, col 2) = index 1 and so…
Gaurav
  • 61
  • 1
  • 3
6
votes
2 answers

RecyclerView wrap_content with GridLayoutManager

I've seen workarounds with LinearLayoutManager, but not with GridLayoutManager. Any ideas?
alan_derua
  • 2,252
  • 3
  • 20
  • 19
6
votes
2 answers

RecyclerView predictive item animations not working (APPEARING)

I have a RecyclerView with GridLayoutManager (support lib v7). I update adapter and make notifyItemMoved. If the item source position is on the screen and the destination position is on the screen as well - "move animation" is played. In case if the…
5
votes
0 answers

Show last item in recycler in center

I have RecyclerView with 2 columns. What I want is to show last item in center if number of items in list is odd. Something like this I have tried implementing all the so threads from here…
karan
  • 8,637
  • 3
  • 41
  • 78
5
votes
3 answers

Android - What is Layout Manager?

I have seen many types of layout managers like: LineraLayoutManager RecyclerView.LayoutManager ListViewLayoutManager etc What actually LayoutManager is and why it is used and what are the different types of LayoutManagers? Do in android all UI…
5
votes
9 answers

How to Maintain Scroll position of recyclerView on Screen Rotation

I'm populating the recyclerView with gridlayoutManager. Now I want to save the scroll position on Screen Rotation. I've tried to do so using onSaveInstanceState and onRestoreInstanceState() as shown in this post : How to save RecyclerView's scroll…
5
votes
1 answer

RecyclerView - how to make GridLayoutManager force place some item on next row

I use GridLayoutManager to place items in RecyclerView vertically. Each item oocupies one span. Now I want some items to end current row, so next item is placed on new row below it. Each item must can occupy only one span, so that they're all same…
Pointer Null
  • 39,597
  • 13
  • 90
  • 111