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
48
votes
12 answers

Scrollbar not showing in RecyclerView

I've got a RecyclerView and would like to have scrollbar showing, when it covers more than one page. I get no scrollbar at all. Any idea? My layout:
47
votes
4 answers

TableLayout with RecyclerView

There is only two layout manager for RecyclerView: LinearLayoutManager and GridLayoutManager. Is there a way to use TableLayout as layout manager with RecyclerView? Any suggestion? EDIT: I wonder if there is any solution without writing a layout…
Joseph K.
  • 784
  • 1
  • 9
  • 19
47
votes
8 answers

Android - Implementing search filter to a RecyclerView

I need to implement a search feature based on an EditText to my RecyclerView. The list must be filtered while typing. Here's the code : DisplayAdapter.java this is the adapter public class DisplayAdapter extends…
Thorvald
  • 3,424
  • 6
  • 40
  • 66
47
votes
3 answers
47
votes
5 answers

RecyclerView smoothScroll to position in the center. android

I am using a horizontal layout manager for my RecyclerView. I need to make RecyclerView in the next way: when click on some item - make smoothScrool to that position and put that item in the center of RecyclerView (if it possible, for example, 10…
Stan Malcolm
  • 2,740
  • 5
  • 32
  • 53
47
votes
5 answers

RecyclerView items with big empty space after 23.2.0

After update to v23.2.0 in my RecyclerView I have items with huge empty vertical space, between the items. My item layout is very simple:
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
47
votes
6 answers

RecyclerView Swipe with a view below it

I have been doing some research and I have yet to find an example or implementation that allows you to put a view (Example Image Below) underneath the RecyclerView when you swipe. Does anyone have any example or an idea of how this would be…
Eugene H
  • 3,520
  • 3
  • 22
  • 39
47
votes
5 answers

LinearLayoutManager setReverseLayout() == true but items stack from bottom

This seems like it would be an easy solution, but it seems that setting private RecyclerView mRecyclerView; private RecyclerView.Adapter mAdapter; private LinearLayoutManager mLayoutManager; .... // More code mRecyclerView = (RecyclerView)…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
46
votes
5 answers

Viewpager2 with fragments and Jetpack navigation: Restore fragments instead of recreating them

I have a Viewpager2 inside a Fragment (lets call it HomeFragment). That Viewpager itself also contains Fragments. When I navigate away from the HomeFragment its view will be destroyed and when I navigate back the view will be recreated. Now I set…
46
votes
13 answers

RecyclerView Item Click Listener the Right Way

I use RecyclerView adapter to display data inside an activity, I want to implement onClickListener inside the activity, currently, I am setting onClickListener inside adapter as usual which works fine. public void onBindViewHolder(MyHolder holder,…
Amir Dora.
  • 2,831
  • 4
  • 40
  • 61
46
votes
6 answers

Recyclerview Adapter and Glide - same image every 4-5 rows

I have this problem - just for testing purposes I added ParseFile to one of ParseObject from received list. Instead of showing it only in that row it shows every 4-5 rows, sometimes more, sometimes less. I supspect that recycling view have something…
jean d'arme
  • 4,033
  • 6
  • 35
  • 70
46
votes
10 answers

How to open a different activity on recyclerView item onclick

i am using a recyclerView to show my listitems in the navigation drawer.I have implemented the onclickListener but i have been stuck on how to open a different activity when items are clicked. All my items do on item click as of now as per the code…
Steve Kamau
  • 2,755
  • 10
  • 42
  • 73
45
votes
4 answers

Cannot call notifyItemInserted() from RecyclerView.OnScrollListener

Recently I upgrade my recyclerview-v7:23 to recyclerview-v7:24.2.0. My applicaton has an endless scroll list. The error message points to the line notifyItemInserted when I add loading view into RecyclerView (null object it means loading, id 0 is…
Angga Ari Wijaya
  • 1,759
  • 1
  • 15
  • 31
45
votes
19 answers

RecyclerView - Scroll To Position Not Working Every Time

I have implemented a horizontal scrollable RecyclerView. My RecyclerView uses a LinearLayoutManager, and the problem I am facing is that when I try to use scrollToPosition(position) or smoothScrollToPosition(position) or from LinearLayoutManager's…
Abbas
  • 3,529
  • 5
  • 36
  • 64
45
votes
4 answers

android - how to catch Drop action of ItemTouchHelper which is used with RecyclerView

I have a problem with ItemTouchHelper of RecyclerView. I am making a game. The game board is actually a RecyclerView. RecyclerView has GridLayoutManager with some span count. I want to implement drag & drop recyclerview's items. Any item can…
okarakose
  • 3,692
  • 5
  • 24
  • 44