Comments (14)
@miquelcopet
The solution which you have suggested is just a hack.Not a solution.Is there a proper way which doesn't decrease the performance of recycler view.
from views-widgets-samples.
any solution for this i am stuck in this problem and after adding holder.setIsRecyclable(false) my recyclyeview scroll lag
from views-widgets-samples.
I have same issue..
Im building chat layout like whatsap which has different views typs in recyclerview like video photos voice and msg views.
The problem is that when i scroll up and down some time the picture message view decreasing there size and some time voice msg decreasing there size and changing color..
Is there anyone to help me.
from views-widgets-samples.
I'm having the same issue. Did you find any fix?
from views-widgets-samples.
Got it!
In onBindViewHolder
you have to remove all the views from the container and then add the new view.
holder.viewGroup.removeAllViews();
holder.viewGroup.addView(view);
from views-widgets-samples.
Hi,
Is there a way to solve this problem without removing All views and without doing setIsRecyclable set to false. Like a solution which doesn't decrease the performance of our recycler view.And Can you explain why this problem generally occurs @techievbv @mangini
from views-widgets-samples.
I'm having the same issue. Anyone have a solution for this?
from views-widgets-samples.
I'm having the same issue. Anyone have a solution for this?
Try this..
https://medium.com/@polson55/smooth-recyclerview-scrolling-in-android-57e7a9b71ca7
from views-widgets-samples.
android:fitsSystemWindows="false" inside CoordinatorLayout will help. Here its explained how you can use a RecyclerView with Multiple View Types.
from views-widgets-samples.
I'm having the same issue. Anyone have a solution for this ?
from views-widgets-samples.
The fix is simple!!
Let me explain, as you know recycler view recycles the views and does not create a new view unless needed. Since its recycling the previously created views its reusing the components inside it. So when the recycled view is reused, the layout is the same one to with it was binded before binding it with the new data. Now when you scroll normally the view gets replaced by the new view quickly and hence you do not notice it, but when you scroll fast the view is visible even before it gets binded. Got It?
Fix:
Just like there is an onBind method available in adapter class, there is an onviewRecycled method too. This method tells when the previous view is getting recycled to be used by a different value. Use this method to do a view cleanup
Example: If in onBind() you are setting an image in ImageView using Glide.with(context).load(uri).into(imageView) then in onViewCleared() you can call Glide.with(context).clear(imageView). This will clear the image view before onBind is called hence you won't see the previous image if you scroll fast.
Hope it helps :-)
from views-widgets-samples.
Is this fixed for anyone? I'm building a chat app. Adapter works fine for me when in getItemViewType(), I return position but adding a new item to the list creates problem in this case. And if I return different two different viewTypes from getItemViewType(), adding new item works fine but list gets stuck in loop when i scroll. Anyone found any solution?
from views-widgets-samples.
Is this fixed for anyone? I'm building a chat app. Adapter works fine for me when in getItemViewType(), I return position but adding a new item to the list creates problem in this case. And if I return different two different viewTypes from getItemViewType(), adding new item works fine but list gets stuck in loop when i scroll. Anyone found any solution?
use delegated Recyclerview adopter
from views-widgets-samples.
Hi,
maybe your problem is that the layout :
- is nested and you try to fill a lot of data in the XML.
- using data binding and use custom data binding.
from views-widgets-samples.
Related Issues (20)
- Viepager2 width changes can cause bugs HOT 2
- RecyclerView inside MotionLayout doesn't work with OnSwipe dragDown
- viewpager2嵌套viewpager2嵌套viewpager2
- MotionLayout.TransitionListener not invoked if swiping fast enough HOT 1
- Fragment is leaking in ViewPager2 onDestroyView HOT 1
- [MontionLayout] Carousel , when in translation , touch to pause
- It sames that RecycleView in Fragment FrameLayout can not be recognized HOT 1
- Exception java.lang.IllegalStateException
- I just wanted to say thank you very much for the code. HOT 1
- [RecyclerView] like compose LazyColumn append item space
- ViewPager2 - slight disappointment. HOT 1
- 从ViewPager迁移到ViewPager2中遇到的问题
- ViewPager2 showing some fragments correctly and some as blank screens
- When adding a RecyclerView as a child/grand-child to the MotionLayout, the Motion-Layout cannot progress across transitions.
- When you will resolve all problems with nested fragments in viewpager2?! HOT 1
- views-widgets-samples/blame/main/RecyclerView/build.gradle is empty
- How would you make SwipeRevealLayout?
- RecyclerSampleKotlin - Unable to Make Field Private HOT 1
- The sample code of viewPager2 detects a memory leak
- Viewpager2 Adding item at 0th position gives issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from views-widgets-samples.