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 show image slider with epoxy #755

Closed Merka84 closed 5 years ago

Merka84 commented 5 years ago

Hi @elihart

First of all, thanks for the great work and this extremely helpful library which makes using RecycleView much faster and easier especially for complicated views.

I have a question. I see that in Airbnb app, you have used image sliders inside recycleView. I have the same requirement and I need to show imageSlider with those dots indicators inside a recycleView which is being produced by epoxy. Can you give me a hint on how to do it with epoxy?

Any suggestion is highly appreciated.

elihart commented 5 years ago

Hi, this is pretty easy to setup. It's just a Carousel with a separate dot paging system.

The dot pager is completely separate from Epoxy and works with vanilla RecyclerView. It is open sourced - I can track the link down later for you

On Sat, May 25, 2019, 2:08 AM Merka notifications@github.com wrote:

Hi @elihart https://github.com/elihart

First of all, thanks for the great work and this extremely helpful library. It makes using RecycleView much faster and easier especially for complicated views.

I have a question. I see that in Airbnb app, you have used image sliders inside recycleView. I have the same requirement and I need to show imageSlider with those dots indicators inside a recycleView which is being produced by epoxy. Can you give me a hint on how to do it with epoxy?

Any suggestion is highly appreciated.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/airbnb/epoxy/issues/755?email_source=notifications&email_token=AAU4YKQFPOHO5DO6URXEIGLPXDQYNA5CNFSM4HPUAY42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GV2QKTQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAU4YKTVHW4OTJ2JZJWPRELPXDQYNANCNFSM4HPUAY4Q .

Merka84 commented 5 years ago

@elihart
Thanks for your answer. I tried to make the imageSlider with carousel but it had the look and feel of a horizontal recycleView not an imageSlider, so I don't get how to create it. Can you post few lines of code as a sudo code?

elihart commented 5 years ago

The dot pager is https://github.com/rbro112/Android-Indefinite-Pager-Indicator

The feel is controlled by whatever snap helper is set on the recyclerview - the Carousel in Epoxy uses the standard RecyclerView snaphelper, but at Airbnb we created custom snap behavior that is too complicated to show in a few lines, but I am sure there are many examples of different snapping behavior and samples online

I'm not sure what is different about the look for you - but that is completely controlled by your View setup. We basically just use an ImageView though.

Overall Epoxy binds the data to views - but the snapping behavior and UI you're looking for is just standard RecyclerView setup that is unrelated to Epoxy

Merka84 commented 5 years ago

Sorry for commenting again on a closed issue , but my problem is relevant to this question so I am posting it here.

I can show imageSlider using carousel and PagerSnapHelper. My problem is how to attach IndefinitePagerIndicator library to the same recycleView that holds images. I couldn't figure it so far. I tried using CarouselModelGroup as it was in sampleApp and I can't get the recycleView which shows my list of image to attach it to pagerIndicator.

Merka84 commented 5 years ago

Finally I realized how to do it, using the hint provided in this issue.

Pooja-Abbott commented 3 years ago

@Merka84 Can you please your sample code i have the same requirement .