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
0
votes
0 answers

android.content.res.Resources$NotFoundException: Resource ID #0x7f060057

Please let me know where I am going wrong to get the error because i ma creating an app which is using recyclerview i have one image and one text and one imagebutton in my recyclerview's item layout . but it is giving me error when i am setting…
Umair
  • 585
  • 3
  • 9
  • 21
0
votes
1 answer

Cannot access elements in RecyclerView

I have implemented recyclerview to display the list of items from a webservice. To display the elements I have used a single row which is fed into the recyclerview using Adapter. Now I want to get reference to a button in the single row but I am…
0
votes
0 answers

RecyclerView Drawer Not Clicking

I have built a custom navigation drawer with recyclerview and burger menu by myself. I created the interface for handling item clicks and also the ItemTouchHelper class but the drawer items are not responding to click events, only rapidly closes the…
0
votes
2 answers

Cannot change the background color of selected items of recycler

I want to highlight the selected items in recyclerview. I can count the number of items selected. I want the highlighting as ..... I have tried this code. recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(this, recyclerView,…
konda rahul
  • 141
  • 1
  • 1
  • 11
0
votes
0 answers

RecyclerView with horizontal LinearLayoutManager automatically distribute margin based on number of children

Is it possible to set a RecyclerView that has width = "match parent" (entire screen). If there are fewer children in the view, distribute them evenly instead of pushing them to the left. Here is the screenshot: I don't want the hourly weather icon…
0
votes
2 answers

Setting different color for ActionBar title depending on what option the user has chosen in a RecyclerView

I currently have a Recycler View, When the user clicks a button from the view it goes to a new activity. I would like to set the Title in the Actionbar of the new activity to that of the colour in the recycler view. So in my Example below I would…
0
votes
1 answer

I can't scroll the recyclerView of one fragment

I have 6 fragments in a Sliding tab layout. All of them have RecyclerView implemented in them. I have populated the RecyclerView. But I one of the fragments does not allow me to scroll, but the rest are working fine. See the gif below: This is my…
0
votes
0 answers

Can you manually add a view to a RecyclerView that didn't come from an Adapter?

I'm working on an advanced LayoutManager subclass. It has some special requirements in that it needs to manually add custom views, not associated with those generated by the adapter. I have tried this example code... public class TestLayoutManager…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
0
votes
2 answers

How do you get the current RecyclerView.Adapter from within a RecyclerView.LayoutManager?

RecyclerView's LayoutManager class defines a function called onAdapterChanged(). If you call RecyclerView.setAdapter() when a LayoutManager is already attached, LayoutManager.onAdapterChanged() gets called as expected. However, if you call…
0
votes
2 answers

Can a RecyclerView instantiate more than one 'view' per item?

TLDR: Usually, in a RecyclerView implementation, between the Adapter and the LayoutManager, there is a one-view-per-item ratio. We are hoping to find a way to create multiple views per item. Note: Please don't confuse this with being able to create…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
0
votes
2 answers

recylerView.getItemCount() return only visible on screen items count

I have a RecylerView I want to change active position items view with using recylerView.findViewHolderForAdapterPosition(position) my problem starts here if i scroll to recylerview and position not show on screen i call…
Burak Durmuş
  • 957
  • 10
  • 16
0
votes
2 answers

Android Horizontal Images list with close button on each

I am developing an application in which i am having a view pager with two fragments. In second fragment i want to display the list of images capture from camera or selected from gallery one by one. So the list of images increase after selecting or…
0
votes
0 answers

Recycler view performance

When notifying a recycler view using notifyItemRangeChanged() even with a no-op bindViewHolder(), it is requesting a layout of the entire view hierarchy. Anyone knows why and if there is a way to avoid it?
StarDust
  • 31
  • 1
  • 1
  • 4
0
votes
0 answers

Retrieving data inside of RecyclerView

I want to create this card view inside recycler View. I got this problem.I can't retrieve the data inside of the card views. I want to whenever that Check Box is true, Get the data(Meal, price, and count which is in this example (1)) and add to…
0
votes
0 answers

RecyclerView having trouble displaying Empty case

I am trying to display an Empty view in an app that displays movie posters. I am using a recyclerview - for example when I put my device in flight mode and click refresh I was expecting the app to display the empty state view but this is not the…