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
3 answers

Can recyclerView have the last row with custom item that does not same with the other items?

I have a layout with order list and last row is the total price of those order. And I don't have an idea that how can I do those list items and last row with my desire custom item, together in a recycler view. Do I make some logic in…
KyawLinnThant
  • 617
  • 1
  • 9
  • 20
7
votes
1 answer

Error Inflating Class android.v7.widget.RecyclerView

I am trying to learn about RecyclerView from scratch, and hence I tried to create a view using it. But as soon as I try to open the activity there seems to be an error: Error inflating class android.v7.widget.RecyclerView or class…
Neeraj Yadav
  • 422
  • 6
  • 13
7
votes
7 answers

Getting same item position in RecyclerView, when click on back button

I have implemented one app where I am using RecyclerView in fragments. There are 3 buttons, 1 image and some text on every item. If I scroll and click on "View Profile" button then new activity will open which is running successfully but when I call…
Paramjeet Singh
  • 145
  • 1
  • 3
  • 15
7
votes
2 answers

Avoid scrolling of first row and first column in recyclerview gridlayoutmanager

Created a two way scrollable gridlayout for a TV app view structure from layout file
DJphy
  • 1,292
  • 1
  • 17
  • 31
7
votes
1 answer

How to get view from RecyclerView at specific adapter position and get values from those views?

I have RecyclerView having an ImageView and a TextView for each row layout.In ViewHolder in RecyclerViewAdapter, I have click listener as v.setOnClickListener(new View.OnClickListener() { @Override public void…
7
votes
5 answers

RecyclerView: how to add OnClick() and keep onLongClick() working?

I have an onClickListener set on a CheckBox for a RecyclerView that holds a list of CardViews. The listener is set up in my ItemHolder that extends ViewHolder. An initial click on a CardView checks the CheckBox and toggles the CardView's…
AJW
  • 1,578
  • 3
  • 36
  • 77
7
votes
2 answers

Android Webview is scrolling to the top when click on link

I have a Webview loading static html content in my app. the problem is, when I click on a link or an embed content (tweet, youtube video), the webview is scrolling back to the top. It looks like a JS problem as mentioned here I tried to use a…
Paul Aigueperse
  • 299
  • 3
  • 14
7
votes
0 answers

RecyclerView drag and drop not working with several view types

I am trying to use a RecyclerView with a vertical LinearLayoutManager in order to display a list items. This list can contain several different item types (differents layouts), and it can be reordered by the user using drag and drop. For the item…
7
votes
1 answer

Set focus on recyclerview item

I really want to set focus on a specific RecyclerView item. I tried recyclerView.scrollToPosition(1); in my initializeRecyclerView method. I tried also holder.setSelected(selectedItem==position) without success. Can you please help me ? Here is…
Edwin ZAP
  • 419
  • 1
  • 4
  • 16
7
votes
2 answers

How to generate unique ids for RecyclerView, in case of 2 ids per item?

Background Suppose I have a RecyclerView, which has items that can only be unique if you look at 2 ids they have, but not just one of them. The first Id is the primary one. Usually there aren't 2 items that have the same primary ID, but sometimes it…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
7
votes
2 answers

recyclerView.setOnScrollChangeListener not working

this is my fragment code. i m usimg this code for endless recycler view which is get the data from server when scroll the recycler view item. but the code is not working. in this code recyclerView.setOnScrollChangeListener() not working it shows…
pb007
  • 153
  • 1
  • 5
  • 13
7
votes
2 answers

How Do I Use setOnFocusChangeListener with RecyclerView?

I have the following on onBindViewHolder() in Adapter Class for RecyclerView: holder.answerEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean…
ZNZ MW
  • 75
  • 1
  • 4
7
votes
3 answers

Scrolling Recycler view with Espresso

I have a heterogeneous recycler view and I am trying to scroll it to item at position 30. My test is passing but I cannot see the screen actually scrolling. onView(withId(R.id.content_view)) …
7
votes
1 answer

Recyclerview scrolls down when soft keyboard appears or disappears

The issue is that the recyclerview scrolls down almost a complete row when the soft keyboard appears or disappears. Here is a visual example: The layout for the activity uses a MessageInput and MessageList object from the ChatKit UI library and is…
Calco
  • 1,420
  • 1
  • 17
  • 31
7
votes
1 answer

set Recycler View Visible row count max 3 items even though it has more items

Stuck in this problem about RecyclerView Visible item count Requirement :- RecyclerView has 3+ items but ,need to show 3 items (other items can be reached through scrolling) RecyclerView has <=3 items , need to show the full items Recyclerview…
Sanoop Vasu
  • 81
  • 1
  • 9