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
57
votes
7 answers

RecyclerView is missing

I just installed the new SDK tools (Android L Developer Preview), and I'm trying to use RecyclerView but it seems to be missing. From my understanding I should include the v7 support library, but I can't seem to do that... I can't seem to find the…
Eli Revah
  • 3,626
  • 7
  • 27
  • 33
56
votes
7 answers

How do I create a circular (endless) RecyclerView?

I am trying to make my RecyclerView loop back to the start of my list. I have searched all over the internet and have managed to detect when I have reached the end of my list, however I am unsure where to proceed from here. This is what I am…
ltsai
  • 757
  • 3
  • 8
  • 16
56
votes
6 answers

Error using the RecyclerView: The specified child already has a parent

I am trying to create a listView with a new RecyvlerView Adapter. I have followed the exact guide present on android developer resources. But this is giving me a strange error: The specified child already has a parent. You must call removeView() on…
Zain Zafar
  • 1,607
  • 4
  • 14
  • 23
55
votes
3 answers

It will always be more efficient to use more specific change events if you can. Rely on notifyDataSetChanged as a last resort. RecycleView

after update android studio to arctic fox, I get this warning. But I dont know what is the efficient way to notify data change. in my code I'm filling the adapter from network call and then I notifydatasetchange, but the compiler gave me this: It…
55
votes
7 answers

I want my RecyclerView to not recycle some items

I'm using a RecyclerView with heterogeneous views inside, as seen in this tutorial. I have some items inside that RecyclerView that are RecyclerViews too. Too hard to imagine? Let's say I want to copy the Play Store's layout: One big RecyclerView…
Joaquin Iurchuk
  • 5,499
  • 2
  • 48
  • 64
55
votes
3 answers

Divide elements on groups in RecyclerView

I need to divide elements in RecyclerView on groups with titles (like in the Inbox app on the picture below) so help me please to figure out what approach would be better for my case: 1) I can use Heterogenous layouts for it but it is not so…
Leo
  • 1,683
  • 2
  • 20
  • 25
55
votes
5 answers

Add space to the end of the RecyclerView

I have a recyclerview with a gridlayout. What I want is when the user scrolls to the end of the list (see my bad mockup), there should be an empty space with a height of 50dp, which isn't the same dimensions as my grid. Note that this space is only…
54
votes
9 answers

Android percent screen width in RecyclerView item

How would I get a RecyclerView's item height to be, say, 30% of the screen's height? I can't simply use a ConstraintLayout or a PercentFrameLayout/PercentRelativeLayout, since those position child layouts relative to parent layouts, whose size might…
davidchuyaya
  • 3,960
  • 2
  • 16
  • 26
54
votes
4 answers

Android : Control Smooth scroll over recycler view

I am using Recyclerview with CardView. I am aware how to control speed on list view. But not for Recyclerview. I searched a lot in found class name SmoothScroll. How to use that? I have no Idea! Right now Recyclerview by default scroll is…
54
votes
10 answers

Support RecyclerView doesn't show anything until touched

I'm using the support RecyclerView in my app, and I see the most bizarre thing. It doesn't display any items until I touch to scroll. Then, all of a sudden, the RecyclerView populates itself. I have verified that the list backing the adapter is…
WindsurferOak
  • 4,861
  • 1
  • 31
  • 36
53
votes
6 answers

ListAdapter submitList() - How to scroll to beginning

I have an issue with my RecyclerView and ListAdapter. Through an API, I receive items in a ascending order from older to newer. My list is then being refreshed by calling the submitList(items) method. However, since everything is asynchronous, after…
gbaccetta
  • 4,449
  • 2
  • 20
  • 30
53
votes
6 answers

CoordinatorLayout using the ViewPager's RecyclerView

I am using the view CoordinatorLayout from android.support.design. I want to attach the app:layout_behavior to the fragment's RecyclerView? In the example given by Google, they only attach it in the RecyclerView of the same XML file where the…
53
votes
9 answers

"LayoutManager is already attached to a RecyclerView" error

I am trying to have multiple RecyclerViews in a layout but I get the following error: "LayoutManager is already attached to a RecyclerView" The Java code is: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, …
TheoK
  • 3,601
  • 5
  • 27
  • 37
53
votes
7 answers

How to get the Scrollposition in the Recyclerview/Layoutmanager?

How to get the scrollposition in Recyclerview or the Layoutmanager? I can measure the scrollposition by adding an OnScrollListener, but when the Orientation changes scrollDy is 0. mRecyclerView.setOnScrollListener(new…
seb
  • 4,279
  • 2
  • 25
  • 36
53
votes
4 answers

Display a RecyclerView in Fragment

I'm trying out the new RecyclerView in Android Lollipop and I'm stuck. I'm trying to receive a list, with an icon and a TextView to the right of the icon, inside a Fragment. I found this great tutorial on how to set up a RecyclerView. I have…