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
45
votes
5 answers

Android RecyclerView below Toolbar

I have a custom RecyclerView and a toolbar which hide when scrolling down and appears when scrolling up. I have a problem about the position of RecyclerView, it is below the Toolbar, I use the behaviour but it seems not working. My xml:
user4789408
  • 1,196
  • 3
  • 14
  • 31
45
votes
7 answers

How to implement setOnScrollListener in RecyclerView

How Do I show progress bar at bottom when user reached to items those are visible in a list. I have written a code in which i am getting data using web service, now i would like to populate partial records, because i have around 630 records in my…
44
votes
7 answers

Horizontal RecyclerView with items that have dynamic height

So I need a horizontal RecyclerView. However, the items in them have dynamic heights based on what's returned from the backend. The RecyclerView and its items have the height of "wrap_content" The problem is if the first visible items in the…
Gak2
  • 2,661
  • 1
  • 16
  • 28
44
votes
4 answers

RecyclerView ScrollListener inside NestedScrollView

I have an EndlessRecyclerView at the end of a NestedScrollView. EndlessRecyclerView means: when user scrolls to the bottom of the recyclerView it loads more data. This is already implemented and working elsewhere but when I put the recyclerView…
44
votes
7 answers

Recycler view item fill up entire recycler view height after upgrading support library from "23.1.1" to "23.2.1"

Previously, I'm using the following old support libraries "23.1.1". compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:preference-v7:23.1.1' compile…
44
votes
8 answers

Espresso, scrolling not working when NestedScrollView or RecyclerView is in CoordinatorLayout

It looks like CoordinatorLayout breaks the behaviour of Espresso actions such as scrollTo() or RecyclerViewActions.scrollToPosition(). Issue with NestedScrollView For a layout like this one:
44
votes
10 answers

Don't collapse Toolbar when RecyclerView fits the screen

I've made an app using Android Design Library, with a Toolbar and TabLayout. Actually 2 tabs are present, both with 2 RecyclerView, that automatically collapse the Toolbar when scrolled. My question is: can I disable Toolbar collapsing when…
44
votes
4 answers

Handle on item long click on recycler view

I have an adapter that customizes a recyclerView and I want to open a popup menu on long click event on recyclerView's items. How can I do this?
44
votes
6 answers

Google Maps Lite Mode causes jank in RecyclerView

I have a RecyclerView which is a vertical scrolling list of items. Each list item contains a Google Maps V2 MapView in Lite Mode. I'm taking advantage of this new feature which returns bitmaps instead of a full-blown map as a replacement to the…
43
votes
12 answers

RecyclerView gets crashed [IllegalArgumentException] when use notifyItemChanged from Handler using Runnable

I'm using RecyclerView as a list to show songs that can be downloaded. Each item has ProgressBar in its View. When the download starts, then I use a Handler to notify each item to update the ProgressBar to show the song download progress. Q1. Is…
Amrut Bidri
  • 6,276
  • 6
  • 38
  • 80
43
votes
10 answers

How to click on an item inside a RecyclerView in Espresso

I have a RecyclerView (R.id.recyclerView) where each row has an image (R.id.row_image) and a TextView. I want to click on the image in the first row. I've tried to use onData(..) but it doesn't seem to work.
Jacki
  • 431
  • 1
  • 4
  • 3
43
votes
10 answers

Background Selector in RecyclerView Item

I'm using the RecyclerView like below: and my list item:
ademar111190
  • 14,215
  • 14
  • 85
  • 114
42
votes
2 answers

Kotlin One type argument expected for class for abstract generic view holder

I'm trying to create a RecyclerView.Adapter with the following: View holders - Provided the abstract parent and one son abstract class BaseSettingsViewHolder(var viewDataBinding : ViewDataBinding) :…
Udi Oshi
  • 6,787
  • 7
  • 47
  • 65
42
votes
9 answers

Add margins to divider in RecyclerView

i am building an android app which is using RecyclerView. I want to add dividers to RecyclerView, which I did using this code: DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),…
Random Guy
  • 560
  • 1
  • 5
  • 11
42
votes
8 answers

Large gap forms between RecyclerView items when scrolling down

I'm making a ToDo list app, and while testing it, for some reason, a huge gap forms between the items whenever I try to scroll down. It always happens whenever I Drag and Drop the items, but I don't see any errors with my ItemTouchHelper adapter and…
planetastro
  • 1,716
  • 2
  • 15
  • 28