Questions tagged [staggeredgridlayout]

99 questions
6
votes
2 answers

NullPointerException in StaggeredGridLayoutManager

I'm getting some crash reports about a NullPointerException happening in StaggeredGridLayoutManager. Looks like around 10% of my users are suffering this issue. I have a very basic RecyclerView with a basic adapter, nothing special, and I did try to…
5
votes
3 answers

Cells are not staggered in using RecyclerView with StaggeredGridLayoutManager in Android

I am developing an Android app. I am not good in Android development. In my app, I am using RecyclerView and CardView with StaggeredGridLayoutManager. Because I want each cell size in the list different to each other and staggered like in below…
5
votes
3 answers

How to find cell width from StaggeredGridLayoutManager?

I have a StaggeredGrid in a RecyclerView and I am trying to dynamically set the image height in the onBindViewHolder. I thought the StaggeredGrid was supposed to handle all this automatically, so I set android:layout_width="match_parent and…
4
votes
0 answers

Can staggered manage view based on the content's width and scroll as vertical?

I am using staggered view to create view tag which will contain text-view but I am facing a problem to manage my content If I am using Staggered Horizontal Manager this is managing my tags based on content's width as I want but the scrollable is…
Abdul Rizwan
  • 3,904
  • 32
  • 31
4
votes
1 answer

StaggaredGridLayoutManager not working properly

I am trying to change the view from Grid to list and list to Grid using Recyclerview. when i Run my app first i am getting view in grid manner like first image Now when i click on icon to convert view from Grid to list i am getting it list…
Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96
4
votes
2 answers

RecyclerView with wrap content items

I need to implement next UI element: Unknown size list of strings (That came from a server call) Any item should be wrap content. If an item is not fits to row, he will be in the next row. All list/grid is centered I thought of using…
4
votes
1 answer

Using setSpanSizeLookup with StaggeredGridLayoutmanager

When I try to use setSpanSizeLookup with GridLayoutManager, it works without error. However, using the same setSpanSizeLookup with StaggeredGridLayoutManager gives an error. It isn't a valid class apparently. Is there any way to use…
4
votes
1 answer

How to prevent item reordering in StaggeredGridLayoutManager after orientation change?

I know this question sounds similar to others on StackOverflow but this is specifically about what happens after an orientation change. I have an Activity with a Toolbar and a RecyclerView. I use a StaggeredGridLayoutManager with a vertical…
4
votes
1 answer

Async image downloading to StaggeredGridLayout

I've got a list of URLs which point to images that have different dimensions. I want to show them in a staggered vertical grid, stretching the width of each image to occupy a single row and stretching the height to wrap around the scaled image.…
nefry
  • 69
  • 5
4
votes
1 answer

Know when RecyclerView items are shown for the first time (Android)

I'm trying to use Google Analytics Enhanced Ecommerce to send "impressions" of my products on a RecyclerView StaggeredGrid. Every time a user scroll, I check which products are visible and send a Hit: public void onScrollStateChanged(RecyclerView…
3
votes
1 answer

Android how can I achieve a arrow based layout?

I want to know how is possible to achieve a arrow-based layout like this : Any idea about what Layout is using this app in order to achieve that layout ? It seems like a kind of Staggered Grid Layout maybe ? Or maybe is using a library or a…
3
votes
1 answer

Staggered Grid Layout Manager that works in both orientations

What I'm trying to do: I'm trying to create a staggered grid layout that takes items with varying width and height. The layout dynamically moves items around so they don't overlap. What I have tried: I looked into using the default…
3
votes
3 answers

Display tag like structure in Staggered Recyclerview

I am working on a tag structure currently and to display that I have used Staggeredgrid layout manager of Recyclerview to get the required result as below image: But when I used StaggeredGrid, It is providing result as below: My code to display…
3
votes
1 answer

Getting tile from coordinates on staggered isometric grid

I can't figure out the math. I have a staggered 2d isometric grid, got no problem into converting the grid cells into world coordinates, but now I can't figure out how to reverse the process. Here is the CellToCoord method: public static Vector2…
reonZ
  • 135
  • 2
  • 10
3
votes
3 answers

Recyclerview StaggeredGridLayoutManager - Find last visible item

I am using a Recyclerview with StaggeredGridLayoutManager with Endless Scroll. I want to do a network call when the last item of the list is visible to the user. So here is my code: public RecyclerViewAdapter(Context context) { …
Vamsi Challa
  • 11,038
  • 31
  • 99
  • 149