ImaginativeShohag / Why-Not-Image-Carousel

Why Not use Image Carousel if you have lots of images to show!
https://imaginativeshohag.github.io/Why-Not-Image-Carousel/
Apache License 2.0
466 stars 68 forks source link

Using carousel in a RecyclerView #81

Closed moghaf closed 1 year ago

moghaf commented 2 years ago

Hi, I'm trying to use this awesome library in a RecyclerView. Almost everything is ok but after the RecyclerView item - that contains a carousel in it - gets unbound and then again comes in the view and shows up, the CircleIndicator2 view gets disappeared. I also got this error: The first view is not found! Maybe the app is in the background. and found out it's because of the infinite scrolling being enabled and turning it off apparently prevents the error but I actually want to use the infinite scrolling feature. I think these two are related. I don't know if the carousel is ok to be used in the RecyclerView or not but I want to know if there is anyway to solve this problem?

ImaginativeShohag commented 2 years ago

Can you share some code? How you bound and unbound the carousel? The carousel may get reset, but should not get crashed!

moghaf commented 1 year ago

I Solved the problem by changing CircleIndicator2 view visibility to VISIBLE after setIndicator function call. I didn't find out why it's visibility was changing to GONE in onBindViewHolder after the view had been recycled.