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
7
votes
1 answer

Recyclerview set clipChildren

How can I allow the children of my RecyclerView to draw on each other like children of a ViewGroup normally do with clipChildren="false"? I use CardViews in my RecyclerView and I want the shadow of one CardView to cover the CardView below.
7
votes
3 answers

GapWorker with Scrapped or attached views may not be recycled. isScrap:false isAttached:true

When i scroll my recyclerview too fast i am getting the following crash java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true …
Reprator
  • 2,859
  • 2
  • 32
  • 55
7
votes
3 answers

RecyclerView with SnapHelper, item is not snapped after scrollToPosition

I have a RecyclerView in my activity and a LinearSnapHelper attached to it: TimePickerAdapter timePickerAdapter = new TimePickerAdapter(hours); recyclerView = (RecyclerView) root.findViewById(R.id.recycler_view); final SnapHelper snapHelper = new…
dragoon
  • 5,601
  • 5
  • 37
  • 55
7
votes
3 answers

RecyclerView scroll dosen't work with NestedScrollView

I have a layout where I have a NestedScrollView containing an Image, multiple buttons and a RecycleView. When I say recycleView.smoothScrollToPosition or recycleView.scrollToPosition() it doesn't do anything at the moment. Refuse to scroll even a…
narancs
  • 5,234
  • 4
  • 41
  • 60
7
votes
1 answer

Can AppBarLayout with RecyclerView works without letting RecyclerView over-scroll?

I have a layout with CoordinatorLayout, AppBarLayout and RecyclerView as below.
7
votes
3 answers

Why findLastCompletelyVisibleItemPosition() is returning -1?

I am trying to do endless recycler view, using pagination in a fragment . But facing problems as follows. findLastCompletlyVisibleItemPosition() or findFirstCompletelyVisibleItemPosition() is returning only -1. if setNestedScrollingEnabled(false),…
Saurabh
  • 136
  • 1
  • 1
  • 11
7
votes
3 answers

Android Recycler view adapter filter with animation

I am trying to optimize the filter method for RecyclerView Adapter in Android. The list is used as an ArrayList. I have seen this post but they are filtering from the original list every time. Example: if there are 10 results for String 'a' then…
Harish Gyanani
  • 1,366
  • 2
  • 22
  • 43
7
votes
5 answers

Android Firebase chat RecyclerView auto scroll to bottom when new item is added

im developing an android chat using firebase. i tried to research about this problem but i cant find a good solutions. hope someone can help me. my problem i want the RecyclerView to auto scroll if new item is added. here is my…
7
votes
0 answers

Persistent bottom sheet with recycler view

I have a scrollable view with persistent bottom sheet in a coordinator layout. Is it possible to automatically adjust bottom margin to scrollable view when bottom sheet is shown? Otherwise bottom sheet overlaps some items in scrollable…
7
votes
2 answers

how to implement filterable in RealmRecyclerViewAdapter

I'm using well RealmRecyclerViewAdapter. My problem is to implement a Filterable that not works. This is the code: private class AirportAdapter extends RealmRecyclerViewAdapter implements Filterable { Context…
ste9206
  • 1,822
  • 4
  • 31
  • 47
7
votes
0 answers

Maintain scroll position in nested RecyclerViews

I have a ViewHolder that contains another RecyclerView. This type of the ViewHolder gets reused multiple times. Since the ViewHolder is shared between different items, the scroll position of the RecyclerView is also shared between items. Eg, You…
7
votes
5 answers

Android LinearSnapHelper - how to increase scrolling/"snapping" speed?

I'm using a LinearSnapHelper to make items in my RecyclerView "snap" into place on the screen (my cards take up most of the screen, so I want them to snap into place and fill the screen on every swipe/fling/scroll). I'm struggling with how to make…
user1743027
7
votes
3 answers

Custom RecyclerView's LayoutManager. Automeasuring after animation finished on item delete

I've created a custom layout manager for RecyclerView. I've enabled auto-measuring in constructor of my manager via setAutoMeasureEnabled(true) When RecyclerView's layout_height is set to wrap_content with this property LayoutManager is able to…
Beloo
  • 9,723
  • 7
  • 40
  • 71
7
votes
2 answers

Testing RecyclerView if it has data with Espresso

I need to write a test to click, let's say on the first item in my RecyclerView. At some cases the RecyclerView will be empty and therefore if I click on the position with 0 index it will fail. How do I write a test like this? To check first if the…
MikeB
  • 257
  • 1
  • 4
  • 15
7
votes
4 answers

Loading image with glide is slow

I have app connect with server and when pics load seems so slow and when scroll that up and down seems glide want read image again! This is my adapter of glide: DataAdapter: public class DataAdapter extends…
Erfan
  • 3,059
  • 3
  • 22
  • 49
1 2 3
99
100