epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

feat: Add aggregate visibility state changed callback

Open shinwan2 opened this issue 1 year ago • 0 comments

To fix https://github.com/airbnb/epoxy/issues/1343, I believe a new callback that reports the latest visibility state(s) for that EpoxyVisibilityItem should be introduced. Without this aggregate information, client will need to somehow batch the VisibilityState by themselves for 1 vi.update cycle. To avoid object allocation, instead of using data class AggregateVisibilityState I just expose the properties from EpoxyVisibilityItem as read-only.

Alternatively to fix https://github.com/airbnb/epoxy/issues/1343, we could change the ordering of VisibilityState emission on onVisibilityStateChanged. Please let me know if that's preferred.

Test

I have included comparing the aggregate visibility state in EpoxyVisibilityStateTrackerTest.

shinwan2 avatar Jun 07 '24 16:06 shinwan2