Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger visibility track in onResume for CarouselModel_ #1379

Open
vibindas-m opened this issue May 2, 2024 · 0 comments
Open

Trigger visibility track in onResume for CarouselModel_ #1379

vibindas-m opened this issue May 2, 2024 · 0 comments

Comments

@vibindas-m
Copy link

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 vibindas-m changed the title clearVisibilityStates() is not clearing the model inside CarouselModel_ Trigger visibility track in onResume for CarouselModel_ May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant