Questions tagged [android-recyclerview]

The RecyclerView widget is a more advanced and flexible version of ListView and GridView.

The RecyclerView widget is a more advanced and flexible version of ListView and GridView. This widget is a container for displaying large datasets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events.

• See how to create a list with RecyclerView.


RecyclerApdater Adapter optimized for RecyclerView

The RecyclerView class simplifies the display and handling of large data sets by providing:

  1. Layout Managers for positioning items
  2. Default animations for common item operations, such as removal or addition of items

enter image description here

Tag Usage:

29237 questions
42
votes
7 answers

Clicking on item programmatically in RecyclerView

I am loading a list of categories and depending on which is selected, I need to show the products of the corresponding category in the RecyclerView. So when I first start the Fragment I need to simulate the user clicking in a default category - in…
noloman
  • 11,411
  • 20
  • 82
  • 129
42
votes
6 answers

Ripple effect over a RecyclerView item containing ImageView

I have a RecyclerView that expands the following grid item :
Binoy Babu
  • 16,699
  • 17
  • 91
  • 134
42
votes
7 answers

how to keep RecyclerView always scroll bottom

I Use Recyclerview Replace with list view I want to keep Recyclerview always scroll bottom. ListView can use this method setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL) RecyclerView I use method…
lj wang
  • 423
  • 1
  • 4
  • 5
42
votes
18 answers

Error inflating class android.support.v7.widget.RecyclerView

I'm trying to use RecyclerView in my existing project, builds without errors but getting no class found error for the RecyclerView while inflating. Cannot see what I'm doing wrong. Thanks for helping! //activity_main.xml
nomongo
  • 3,435
  • 7
  • 30
  • 33
41
votes
4 answers

What is the ItemDecoration for Jetpack Compose LazyColumn?

In JetpackCompose, we can use LazyColumnFor as RecyclerView. In RecyclerView, to have a proper margin/padding between items, we need to use ItemDecoration, as per this article Like below class MarginItemDecoration(private val spaceHeight: Int) :…
41
votes
4 answers

make RecyclerView's height to "wrap_content" in Constraint layout

i'm trying to set the height of recycler view on wrap_content and make it respect that,but it will exceed the other widget on layout. what can i do now?
Ali Samawi
  • 1,079
  • 1
  • 9
  • 18
41
votes
9 answers

How to set the height of an item row in GridLayoutManager

My Recycler Item which inflate in onCreateViewHolder
Kunal
  • 953
  • 1
  • 10
  • 14
40
votes
11 answers

Detect animation finish in Android's RecyclerView

The RecyclerView, unlike to ListView, doesn't have a simple way to set an empty view to it, so one has to manage it manually, making empty view visible in case of adapter's item count is 0. Implementing this, at first I tried to call empty view…
Roman Petrenko
  • 1,052
  • 1
  • 9
  • 21
40
votes
3 answers

Setting app:layout_behavior programmatically

I have a coordinator layout with a recyclerview which I would like to add programmatically. The reason why it's added programatically is because different fragments which inflate the coordinator layout, may use different types of recyclerviews.…
40
votes
13 answers

RecyclerView items duplicate and constantly changing

What's Happening: The list (RecyclerView) is mixing up the data when I scroll. I.E when I scroll back up after scrolling down, some of the list items are repeated, not displaying proper content. package jamesnguyen.newzyv2.UI_update; import…
James Nguyen
  • 446
  • 1
  • 4
  • 6
40
votes
17 answers

Android Toolbar moves up when keyboard appears

I'm creating a chat based UI screen where I have toolbar and recyclerview for chat messages, and reply msg layout. Whenever edittext get focus It moves up the toolbar. Instead I would like to resize the recyclerview. some of the stackoverflow…
40
votes
7 answers

Add two sections in recyclerview android

In my application i am using recyclerview to display all contact list. I want two section in recyclerview. Like one section is my application contact list and second section is my phone contact list. Like this Is there any method to do it? Does…
Kinjal
  • 1,195
  • 4
  • 13
  • 24
40
votes
7 answers

Two RecyclerViews under each other in one layout

How can I get two RecyclerViews under each other in one layout? I don't want to have a single RecyclerView for all items. My…
alan_derua
  • 2,252
  • 3
  • 20
  • 19
40
votes
5 answers

How to add a button at the end of RecyclerView?

I want to show a button at the end of RecyclerView. With ListView there was a method addFooterView(), how to do the same with RecylerView.
Vrutin Rathod
  • 900
  • 1
  • 12
  • 16
40
votes
4 answers

Android RecyclerView: Change layout file LIST to GRID onOptionItemSelected

I am developing an Android Application for Online Shopping. I have created following view for List of Products using RecyclerView, in that i want to change view on selecting option menu item: I have created following adapter named ProductAdapter, in…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437