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
63
votes
9 answers

notifyDataSetChanged not working on RecyclerView

I am getting data from server and then parsing it and storing it in a List. I am using this list for the RecyclerView's adapter. I am using Fragments. I am using a Nexus 5 with KitKat. I am using support library for this. Will this make a…
Vamsi Challa
  • 11,038
  • 31
  • 99
  • 149
62
votes
31 answers

RecyclerView is cutting off the last item

I have a fragment with a toolbar and a recyclerView inside it. I am populating the recyclerView with dummy data and then try to show them. For some reason, the last element of the recyclerView is getting cut-off. This is the XML of the…
Sotiris Falieris
  • 911
  • 1
  • 10
  • 18
62
votes
8 answers

No animation on item removal on RecyclerView

I am using RecyclerView for the first time. Everything is working fine except that there is no animation on item removal even though the animation on item addition works just fine. I have not set any custom item animator, but according to the…
Jordi Chacón
  • 1,723
  • 1
  • 14
  • 20
61
votes
4 answers

How to put RecyclerView inside NestedScrollView?

With creation of NestedScrollView you can put scrolling view inside another scrolling view as long as those implement NestedScrollingChild and NestedScrollingParent correctly. (This is not bad design pattern "Ian Lake (from Google) actually…
mmlooloo
  • 18,937
  • 5
  • 45
  • 64
60
votes
9 answers

Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,

my RecyclerView do not call onCreateViewHolder, onBindViewHolder, therefore, does not appear nothing in recyclerview. I put logs for debugging, and no log is shown. What can be? My adapter: public class CommentListAdapter extends…
SanatiSharif
  • 946
  • 1
  • 7
  • 15
59
votes
5 answers

NestedScrollview won't start from top

I have a Recyclerview in a NestedScrollview.. everything is working fine except one thig. I have total three view in NestedScrollview First two are LinearLayout then Recyclerview. when i run my app the Activity don't show top two layout it starts…
Suvro
  • 691
  • 1
  • 6
  • 8
58
votes
13 answers

RecyclerView ItemTouchHelper Buttons on Swipe

I am trying to port some iOS functionality to Android. I intent to create a table where on swipe to the left shows 2 button: Edit and Delete. I have been playing with it and I know I am very close. The secret really lies on the method OnChildDraw.…
Gustavo Baiocchi Costa
  • 1,379
  • 3
  • 16
  • 34
58
votes
12 answers

Force RecyclerView to redraw its items

Is there any way to redraw all items of RecyclerView? I have some Themes (in style.xml) and after changing the theme, I need the RecyclerView to be redrawn. So I want a method that will force to re-call onCreateViewHolder for each items of the…
Denis Covaci
  • 1,137
  • 1
  • 8
  • 13
58
votes
18 answers

(Smooth)ScrollToPosition doesn't work properly with RecyclerView

I'm using basic RecyclerView with GridLayoutManager. I observed that nor smoothScrollToPosition nor scrollToPosition works properly. a) when using smoothScrollToPosition I often receive error from RecyclerView "RecyclerView﹕ Passed over target…
58
votes
9 answers

Recyclerview painfully slow to load cached images form Picasso

I have implemented a RecyclerView that contains mainly images which is loading in through Picasso. My problem is that as soon as I scroll down or up the view, the placeholder image appears for approx. a second before it is replaced by the actual…
57
votes
12 answers

How to set RecyclerView Max Height

I want to set Max Height of RecylerView.I am able to set max height using below code.Below code makes height 60% of current screen. DisplayMetrics displaymetrics = new DisplayMetrics(); …
Maulik Dhameliya
  • 1,470
  • 1
  • 17
  • 21
57
votes
5 answers

How to use RecyclerView.scrollToPosition() to move the position to the top of current view?

The RecyclerView.scrollToPosition() is extremely strange. for example, supposed a RecyclerView named "rv". if now item 10 is under the current RecyclerView, call rv.scrollToPosition(10), the RecyclerView will scroll item 10 to bottom. if now item…
cryyyyy
  • 619
  • 1
  • 6
  • 5
57
votes
15 answers

Hide FloatingActionButton on scroll of RecyclerView

I want to hide/show FloatingActionButton on scroll of RecyclerView. My XML layout :
57
votes
4 answers

How to have a ListView/RecyclerView inside a parent RecyclerView?

I want to add some child Views (List Items), which come to me from JSON formatted data. Each child list is under a parent list item row. How can I populate it in RecyclerView for each row item (Parent items with child list items)? I have tried using…
Ravi Kabra
  • 1,284
  • 1
  • 11
  • 17
57
votes
5 answers

Put an indeterminate progressbar as footer in a RecyclerView grid

How to get indeterminate circular indicator for "Scroll up to load more" in a grid RecycleView? The pattern is described there: http://www.google.com/design/spec/components/progress-activity.html#progress-activity-behavior in "Two-phased loads" and…
Alex Facciorusso
  • 2,290
  • 3
  • 21
  • 34