Questions tagged [android-viewholder]

A ViewHolder object stores each of the component views inside the tag field of the Layout, so you can immediately access them without the need to look them up repeatedly. The ViewHolder pattern is often used in Android applications to improve performances of view access.

A ViewHolder object stores each of the component views inside the tag field of the Layout, so you can immediately access them without the need to look them up repeatedly. The ViewHolder pattern is often used in Android applications to improve performances of view access.

For an example, check the official Android documentation on the ViewHolder pattern.

1064 questions
4
votes
1 answer

Edit text weird behavior

I have an ExpandableListView which contains a RecyclerView of a custom layout. This layout contains some views including my EditText. My behavior is : When I click in my number EditText, the keyboard appears for about 0.5s, the whole layout is…
4
votes
1 answer

FirebaseRecyclerAdapter with 2 different database references - negative impact on scrolling

Simple thing I would like to do (see in the picture) Display a view with info coming from 2 different places in Firebase so that it behaves in a professional way scrolling UP and DOWN I have a list of movies and on each of them I would like the…
4
votes
2 answers

Android RecyclerView switching layouts (grid/list) old viewHolders used

Issue Summary I have a RecyclerView list in an activity with an actionBar button used to switch the RecyclerView between a LIST and a GRID layout. The layouts of the items are different when viewing the list as a LIST and as a GRID. When viewing…
se22as
  • 2,282
  • 5
  • 32
  • 54
4
votes
4 answers

How do I use Viewholder with ExpandableListView?

I'm trying to create an ExpandableListView in my app. It has 2 groups: the first is colours, and the second is symbols. The first group clicked on works fine. The second group, however, shows the rows from the first group (if the second group has…
Sharon
  • 3,471
  • 13
  • 60
  • 93
4
votes
0 answers

Preloading view in recyclerview

I am doing a recyclerview with different viewtypes using the viewholder pattern. As one of my views I have a graphView and the load-time makes my recyclerview stutter when scrolling past it. I have tried initializing the graph in onCreateViewhodler…
MNielsen
  • 117
  • 9
4
votes
4 answers

How to get all RecyclerView ViewHolder?

I want to change all items' text color when I click on one of them. My problem is that the color is changing only on visible items. The color of invisible items does not change at all. New: Also I would like to know how to change the color of the…
kai hello
  • 135
  • 1
  • 2
  • 13
4
votes
2 answers

RecyclerView.Adapter's onCreateViewHolder and onBindViewHolder methods are not getting called

I'm trying to implement TwoWayView in my project by following the sample project provided in that link. I have implemented everything and my code works without any errors but the actual List is not getting inflated. Upon debugging I found out that…
4
votes
0 answers

RecyclerView freezes when start to scroll after restoring from background

Here is my adapter class public class CategoryAdapter extends RecyclerView.Adapter { List mItems; public CategoryAdapter(Context context) { super(); Resources res =…
4
votes
1 answer

How can I access the viewholder of an item in a recycler view?

I have got a recycler view that shows a list of images. I have added an onScrollListener to that recycler view. Now, when a scroll is detected, I would like to set the translation of the imageviews in the viewholders. Therefore I need a reference to…
user2426316
  • 7,131
  • 20
  • 52
  • 83
4
votes
0 answers

OnClickListener of first item of GridView is not working

This question has been answered here But my requirement is to reuse views, as I have to deal with large data so I can't initiate viewholder object every time I need to display view. I'm using grid view with view holder pattern when I reuse…
muak
  • 189
  • 2
  • 10
4
votes
2 answers

ExpandableListView has wrong groupPosition when trying to display child view in Android

I am having an issue that I have been working on for a while. I am using an ExpandableListView with a ViewHolder. I know that the ExpandableListView reuses Views and that is what I think is happening with the problem that I have. I have 3 views in…
James Meade
  • 1,147
  • 5
  • 22
  • 46
4
votes
2 answers

Android: RecyclerView.Adapter doesn't work as expected

My question id directly related to @Richard's one about the method onBindViewHolder() within the RecyclerView.Adapter is not called as he (and I) expected it to do. I noticed that this method is called correctly until the end of my dataset (9…
4
votes
1 answer

How to properly implement an Adapter for a ListView

I have a ListView in a Fragment and I want to update the data in the ListView when I return from another Activity. I have overwritten the onResume() method in the Fragment, modify the data in the Adapter and call notifyDataSetChanged() on the…
3
votes
1 answer

How can I hide an ImageView on my RecyclerView for certain items based on a particular condition?

I have a RecyclerView with an ImageView being a part of the items. I want to hide the ImageView from an item in the RecyclerView if a certain condition is met. How can I do that? I am attaching the image of how I want it to look like. I am just…
3
votes
1 answer

How to call backend from a Recyclerview.ViewHolder

I have a recyclerview and a correspoinding viewholder to hold individual item. The viewholder has button which onClick needs to communicate with backend. I have a repository class that talks with backend present as the part of my activity. class…