airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.53k stars 728 forks source link

Nested horizontal RecyclerViews with first items as sticky headers #1045

Open harmittaa opened 4 years ago

harmittaa commented 4 years ago

Hey! Thanks for the great library, it's a pleasure to use.

However, I've not yet figured out how to create nested horizontal RecyclerViews with sticky headers in each.

I have tried the following:

override fun buildModels() {
        genres.forEach { genre ->
            val movieModels = genre.movies.map { movie ->
                MovieBindingModel_().run {
                    id(movie.id)
                    movie(movie)
                }
            }

            carousel {
                id("movieCarousel${genre.id}")
                models(movieModels)
            }
        }
    }

The above works for creating the nested horizontal RecyclerViews (RV). However, the StickyHeaderCallbacks are only made for each carousel row, which is fine if a whole row should be stickied when scrolling vertically. In my case only the first item of each row should be stickied when scrolling horizontally.

I've already implemented this with normal RecyclerView, below is a screenshot that hopefully helps to visualize the issue.

Screenshot 2020-09-05 at 16 54 14

Any tips are highly appreciated!

Vignesh150493 commented 4 years ago

@harmittaa . Hey Did you find a solution for this?

harmittaa commented 4 years ago

@Vignesh150493 unfortunately not.

Vignesh150493 commented 4 years ago

@harmittaa Maybe we can re-open the issue, to see if someone helps?

harmittaa commented 4 years ago

@Vignesh150493 sure. Please also report back if you figure it out