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

RecyclerView.ViewHolder's setIsRecyclable() func

I want to set my view holder to not recycle, here's the code: @Override public void onBindViewHolder(final ViewHolder viewHolder, final int position) { viewHolder.setIsRecyclable(false); } However, when I see the documentation here:…
2
votes
0 answers

How to authorize an AutoCompleteTextView field to make a limited change to the available options?

I'm trying to make my autoCategory_book variable only allow changing the value change for the options provided by category_book not allowing user input, the problem is that the field is closed for any change, leaving the value shown totally static…
Boranoro
  • 69
  • 5
2
votes
0 answers

How to implement swipe on particular part of view holder in recycler view?

I have a view holder that has a header and body and I want to implement swipe only on the body, so the header stays in place. Any ideas how to do that? I'm currently using ItemTouchHelper.SimpleCallback for swipe to delete items in my recycler…
2
votes
0 answers

Removing views at other adapter positions

Problem: I'm trying to conditionally remove a linear layout component of an item in a recycler view inside the onBindViewHolder section of the adapter but I can't figure out how to access the previous view to do that. How do I go about that? The…
M A F
  • 291
  • 4
  • 14
2
votes
2 answers

Hide and show multiple view holder from RecyclerView Adapter Android

I have two view holders in my custom adapter say ViewHolder1 at position 0 ViewHolder2 at position 1 Currently with view is perfectly fine. Now i have button in MainActivity. I want to do something like this in layman's term On 1st click, it should…
2
votes
2 answers

Blur Surrounding Of Expanded RecyclerView Item (Blur RecyclerView Except Of One Of Its Items)

I have a RecyclerView containing its children: As you can see in the picture, each item can be expanded (for example item i in the picture). In my project I use this blur library to blur things, for example, clicking the FloatingActionButton…
2
votes
1 answer

How can I set a click listener for a RecyclerView list element in order to display an AlertDialog?

I am trying to process the onItemClick event for a RecyclerView list element in order to display an AlertDialog when an item is selected. For that I placed click listener in the method bindViewHolder where I have access to the actual visual…
2
votes
2 answers

Show a specific number of my list on the screen using RecyclerView

I have a list and its size is x numbers. I want to show 6 items on the screen even user scrolled to view the list , it should show 6 items on the screen. I tried this Answer but my item's height was cropped and it didn't work for me. Edit I want to…
2
votes
0 answers

Android folding cell library is not getting width correctly when scrolling a cell in recycler view

I have a recyclerView made up of Folding cells. (library can be found here: https://github.com/Ramotion/folding-cell-android each element in the recyclerView can be clicked on and it will unfold like a paper. onBindViewHolder has a condition to…
bcsta
  • 1,963
  • 3
  • 22
  • 61
2
votes
1 answer

RecyclerView repeats data and scrambles on scrolling

I am using a RecyclerView to display a list of items, but it refuses to display nicely despite my most sincere efforts. The items repeat after the first 14 in portrait and the first 10 in landscape, with the 15th/11th element scrolling its value…
NerdyGinger
  • 406
  • 7
  • 13
2
votes
1 answer

How to use getLifecycle().addObserver() inside RecyclerView adapter

This might be a stupid question for many of you but I can't find a way to use getLifecycle().addObserver() inside RecyclerView adapter.
2
votes
1 answer

Reload Image with Picasso or any Image-loader on click in RecycleView

Updating Image with in Recycleview I am working on chatapp, when user clicks on imageview in Recycleview, I am downloading image to local storage and then trying to reload with picasso, Then Recycleview is jumping to another position. Note : Based…
Guruprasad
  • 931
  • 11
  • 16
2
votes
1 answer

Remove drag and drop for selected cells

I've created drag and drop for my recycler view, but I want disable drag and drop option on pull of cells (it's a headers in my view). How to make them not available for drag and drop function? Drag And drop helper class…
2
votes
1 answer

MapView in lite mode causes RecyclerView to not scroll correctly

I'm building a chat app in Android Studio with the abitily to send routes on a map. I've implemented this by using a RecyclerView and ViewHolders, which hold the necessary UI with MapViews in lite mode (map:liteMode="true"). Thing is, when I add a…
2
votes
3 answers

Get value from clicked item in recycler view

I have a list of items. These data is received from a API and then listed trough a recycle view. This is how it looks now: https://i.stack.imgur.com/NY34j.jpg When I press the heart on one of those items, I want to receive the data from that…