Questions tagged [recyclerview-layout]

RecyclerView is a more advanced and flexible version of ListView. It was introduced with the Android L Developer Preview, but is also available as part of the Support Library.

RecyclerView is a more advanced and flexible version of ListView, introduced in the Android L Developer Preview but also backported to the Support Library. It is a container for large sets of views that can be recycled and scrolled very efficiently.

Yo use a RecyclerView, an adapter (extending RecyclerView.Adapter) and a layout manager (extending RecyclerView.LayoutManager) must be provided. By default, RecyclerView provides LinearLayoutManager, which shows the items in a vertical or horizontal scrolling list.

Official Documentation

Tag Usage:

436 questions
49
votes
11 answers

How to make a page indicator for horizontal recyclerview

Any idea how to create a page indicator for recyclerview list ?
Nima
  • 1,892
  • 4
  • 24
  • 32
21
votes
2 answers

RecyclerView onCreateViewHolder Return Type Incompatibility With Multiple Custom ViewHolders

I'm trying to use multiple ViewHolders in a RecyclerView in order to swap these views out at run time. I have created two classes which extend RecyclerView.ViewHolder: MenuItemViewHolder public class MenuItemViewHolder extends…
18
votes
6 answers

Last Item in recyclerview is cut off

I am using recyclerview to display a list of items and constraint layout is the parent view. The layout is displayed below:
George
  • 2,865
  • 6
  • 35
  • 59
18
votes
3 answers

How to properly set elevation value to recyclerview?

I am working on grid layout using recyclerview in android. The grid occupies a portion of the screen and has a shadow. To get the desired shadow effect I am using an elevation value of 12 dp. But it does not seem to work as I cannot see any…
Neanderthal
  • 937
  • 2
  • 9
  • 25
15
votes
7 answers

How to Limit Number of Items in RecyclerView?

How can I limit the number of items displayed by the RecyclerView ? I can limit the amount inserted it if I override getChildCount, but that causes it to only insert that number and then stop. I want it to keep inserting/scrolling, but only display…
Elliptica
  • 3,928
  • 3
  • 37
  • 68
15
votes
4 answers

What are advances of glide recyclerview integration?

I just tried to use glide recyclerview integration and read a document about it and it said: "The RecyclerView integration library makes the RecyclerViewPreloader available in your application. RecyclerViewPreloader can automatically load images…
15
votes
6 answers

Recycler View Horizontal Scroll with 2 columns

Here is I have I have tried so far LinearLayoutManager layoutManager = new GridLayoutManager(getActivity(), 2, GridLayoutManager.HORIZONTAL, false); but It showed 2 rows instead of two columns. How can I show two items with horizontal…
Chhorn Soro
  • 3,061
  • 8
  • 27
  • 43
15
votes
5 answers

how to show/hide FAB on scroll Recycler view with coordinator parent

I have an activity with coordinator layout.inside activity there is a fragment with Recycler view and float button.how can I show/hide float button when Scroll Recycler view and avoid to use fab behavior?! in activity…
14
votes
4 answers

How to get clicks on RecyclerView (NOT the children)

Is there any way to set an onClickListener on a RecyclerView? I have a RecyclerView with some children in it, and setting an OnClickListener on the parent RecyclerView. However, the onClick doesn't fire when I click on that view. See sample code…
14
votes
3 answers

RecyclerView causes issue when recycling

I have a list of items that I created using RecyclerView. When the user clicks on one of them I change the background color of that selected item. The problem is, when I scroll through my items, and they get recycled, some of the items get the…
Gabriel
  • 578
  • 3
  • 8
  • 22
13
votes
0 answers

Contents of RecyclerView not visible when gap strategy is none

I have a RecyclerView which I use to show 2 column layout with some items as sections, using the full width. This is how I am setting up my RecyclerView: StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2,…
11
votes
9 answers

Skip items in recycler view

Hi I want to skip some items from recyclerview. Here is the bit of code item_Data.xml …
11
votes
1 answer

How to expand space between RecyclerView Item while scrolling

How to expand space between recyclerview item while scrolling as shown below. I tried to add a custom animation in onBindViewHolder method but this solution doesn't work as I want. It looks like some animation add to…
11
votes
3 answers

Recycler view not scrolling properly after implementing swipe to refresh layout

Prior to the implementation of the Swipe to refresh view, the recycler view was working smoothly but not whenever I try to scroll the recycler view downwards the swipe to refresh interferes and hinders the scroll movement. Here is the screenshot of…
11
votes
5 answers

RecyclerView crashes when updating on top

I have a RecyclerView in my app everything is working fine I am while scrolling when the last item is visible I am adding some more item to the bottom and it is working fine. Now what the problem is that I have a Handler which runs after every 5…
Vishwajit Palankar
  • 3,033
  • 3
  • 28
  • 48
1
2 3
29 30