sparrow007 / CarouselRecyclerview

Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Apache License 2.0
634 stars 78 forks source link

setItemSelectlistener will not work when changing adapter with setting alpha #24

Closed arjunbabuc closed 2 years ago

arjunbabuc commented 2 years ago

if(selectedTeam=="homeTeam") { adapter = carousalViewAdapter( homePlayerList!!, basketballData.getTeams[0].colors[0] ) carouselRecyclerview.adapter = adapter carouselRecyclerview.set3DItem(false) setIntervalRatio(0.7f) carouselRecyclerview.setAlpha(true) carouselRecyclerview.setInfinite(false) } else { adapter = carousalViewAdapter( awayTeamPlayerList!!, basketballData.getTeams[1].colors[0] ) carouselRecyclerview.adapter = adapter carouselRecyclerview.set3DItem(false) setIntervalRatio(0.7f) carouselRecyclerview.setAlpha(true) carouselRecyclerview.setInfinite(false) }

In this case ItemSelectListener will only work when all property settings are removed. property will change each time when we set adapter also

sparrow007 commented 2 years ago

@arjunbabuc Would you please check to set all the settings on top (common for if-else) then based on the condition you can set the adapter and try for listener let me know if that's working?

arjunbabuc commented 2 years ago

@sparrow007 each time setting adapter make properties inactive. Anyway i solved this by updating current adapter using update function. Now its working fine

sparrow007 commented 2 years ago

@arjunbabuc I am glad that you solved it, but I will look into these properties inactive thanks for this.