Questions tagged [recyclerview-layout]

RecyclerView is a more advanced and flexible version of ListView. It was introduced with the Android L Developer Preview, but is also available as part of the Support Library.

RecyclerView is a more advanced and flexible version of ListView, introduced in the Android L Developer Preview but also backported to the Support Library. It is a container for large sets of views that can be recycled and scrolled very efficiently.

Yo use a RecyclerView, an adapter (extending RecyclerView.Adapter) and a layout manager (extending RecyclerView.LayoutManager) must be provided. By default, RecyclerView provides LinearLayoutManager, which shows the items in a vertical or horizontal scrolling list.

Official Documentation

Tag Usage:

436 questions
4
votes
1 answer

Showing Ads in Recycler View

I am working with Recycler View in which i have to show two items in GridLayout Manager and span count of 2. GridLayoutManager gridLayoutManager; gridLayoutManager = new GridLayoutManager(getActivity(),…
Karan sharma
  • 1,511
  • 1
  • 13
  • 37
4
votes
1 answer

RecyclerView won't update child until I scroll

I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this. I'm implementing a RecyclerView here and I can't for the life…
SudoPlz
  • 20,996
  • 12
  • 82
  • 123
4
votes
1 answer

How to initialise click listener on Recycler view adapter using Databinding?

I am going to make an universal adapter for all dynamic layouts , normally i handled all this things but i got stuck that how to initialise click listener using interface so that i define in whatever xml and get event in my class. i am following…
4
votes
2 answers

How to display images in recycler view with different sizes

i want to display images in Recycler View You can see images have no fixed height and width. just randomly shown in different sizes. i have considered StaggeredLayoutManager for recyclerview but the problem with that we have to show vertically or…
3
votes
0 answers

Can't scroll to the bottom of RecyclerView

I'm working on simple chat app. When user open chat activity he has to see the messages scrolled to the bottom. But now it doesn't scroll to the bottom. It scrolls to the middle of the last message. See screenshot: The second problem is - when I…
Nastro
  • 1,719
  • 7
  • 21
  • 40
3
votes
3 answers

Change column span count of StaggeredGridLayout dynamically based on item position

I would like to achieve this layout for (n) items list: So far now I'm able to display the items in two columns but how can I merge two columns in one for specific position (i.e as item 7)? I have tried many solution provided at SO and also other…
3
votes
4 answers

Hidden view above RecyclerView

I want to make some hidden filters options above recyclerview (for example like in old versions of spotify): How to do that? I use AppBar above my recycler.
Mateusz Kaflowski
  • 2,221
  • 1
  • 29
  • 35
3
votes
1 answer

Nested RecyclerView onClick not triggered

I have two nested RecyclerViews - basically a list of horizontal RecyclerViews and I am struggling to make the items in the horizontal RecyclerView clickable. This is the main layout
3
votes
3 answers

How to disable pull refresh, When swipe recycler view item?

I'm using a recyclerview inside a SwipeRefreshLayout and when I start to swipe to delete my recycler view item it will active pull to refresh. I want to disable pull refresh when I start swipe and it enable completed swipe. And I used…
3
votes
0 answers

How to show multiple data soruce data in single recycle view or adapter?

I have four type of different data with different view type like the below image . but that is not a problem problem is the data will came from different api. My question is how to combine them in a single adapter because i need to use lazy loading…
3
votes
2 answers

RecyclerView divider width with ItemDecoration

I have a RecyclerView and have added an ItemDecoration to it as follows :- mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST)); My ItemDecoration looks like :- public void onDrawOver(Canvas c,…
3
votes
0 answers

GridLayoutManager - get row index of item

For my custom decorator, I want to add some extra padding in my list at the end. For this usecase I need to know if an item is in the last row of the grid or not. Is this somehow possible? Decorator code so far class SetupHeaderDecorator(private val…
prom85
  • 16,896
  • 17
  • 122
  • 242
3
votes
2 answers

How do I prevent a RecyclerView from running onBindViewHolder for each in-between-child when a scroll is too far away

I have a RecyclerView as a Calendar, and each view is a day. (occupying the full width and height of the screen) .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. …
SudoPlz
  • 20,996
  • 12
  • 82
  • 123
3
votes
5 answers

Android Recyclerview item side by side

I have recycler-view with items in it and can be scrolled vertically. Currently what i achieved is items are added one after another like a list. By i need to place them side by side. Like the image below And my output is My recycler-view setup…
Ahsan Aasim
  • 1,177
  • 3
  • 14
  • 40
3
votes
3 answers

GridLayoutManager spacing is not consistent

So i am using RecyclerView with GridLayoutManager the spacing between the items is not consistent around the item This is how it looks in 4 x 4 Grid This is how it looks in 5 x 5 grid I already tried many solution from this and this and this But…