epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

Trigger visibility track in onResume for CarouselModel_

Open vibindas-m opened this issue 1 year ago • 0 comments
trafficstars

I want to re-trigger the onVisibilityStateChanged using CarouselModel_ in EpoxyRecyclerView when the fragment resumes.

ClearVisibilityStates and requestVisibilityCheck are helping to re triggering the onVisibilityStateChanged event for all components except the items inside CarouselModel_

val customModels = ArrayList<EpoxyModel<*>>() customModels.add( CustomEproxyModel_() .id(viewId) .onVisibilityStateChanged { _, _, visibilityState -> if(visibilityState == VisibilityState.VISIBLE) { Log.d("Eproxy", "CustomEproxyModel_ visible") } } ) CarouselModel_() .id(viewId) .spanSizeOverride { totalSpanCount, _, _ -> totalSpanCount }.models(customModels)

detach and attach visibilityTracker is not working for me.

`override fun onPause() { // Detach the visibility tracker from the RecyclerView visibilityTracker.detach(epoxyRecyclerView) super.onPause() }

override fun onResume() { // Attach the visibility tracker to the RecyclerView visibilityTracker.attach(epoxyRecyclerView) super.onResume() } `

vibindas-m avatar May 02 '24 01:05 vibindas-m