airbnb / epoxy

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

How to make horizontal recycler inside a vertical recyclerView with epoxy? #993

Closed Strikelon closed 4 years ago

Strikelon commented 4 years ago

Hello everyone! Can you advice how to make horizontal recycler inside a vertical recyclerView with epoxy? Here layout for example: https://prnt.sc/stq9z7 Thank you for advice!

elihart commented 4 years ago

this is demonstrated in the sample app, please reference that. generally you just drop the provided Carousel model into a vertical recyclerview

Strikelon commented 4 years ago

Hello! Thank you for advice, carousel works good! I have one more question. Wiki says:"A common behavior in a carousel is to allow the previous and next items to "peek" from the sides. This indicates to the user that there is more content to scroll to." But I don't understand, have I any ways to disable this behavior?

omarel3ashry commented 4 years ago

when you defining the number of views to be shown on screen ,, use int value.

CarouselModel_().id("carousel").models(models).numViewsToShowOnScreen(2.2f)
2.2f -> means to items with 20% of the third item if existed

CarouselModel_().id("carousel").models(models).numViewsToShowOnScreen(2)
2 -> means only 2 items without any peeking