laenger / ViewPagerBottomSheet

Use ViewPagers in Bottom Sheets!
Apache License 2.0
465 stars 86 forks source link

Get BottomSheetBehavior callback #18

Closed rohankandwal closed 6 years ago

rohankandwal commented 6 years ago

Hi, First thanks for the excellent library, can you please let me know how to get callbacks for page events like onSlide and page events like STATE_EXPANDED, STATE_COLLAPSED, STATE_DRAGGING, STATE_SETTLING, STATE_HIDDEN ?

laenger commented 6 years ago

This project is based on the original bottom sheet behavior from the support library and does not change the way callbacks and states work. It looks like your question is related to using bottom sheets in general rather than to this specific variation. I suggest to refer to the documentation of the support library.

rohankandwal commented 6 years ago

I don't want to change the callbacks, I want to get the callbacks, i.e. when the state changes, that's all.

laenger commented 6 years ago

Get the behavior associated with the view using ViewPagerBottomSheetBehavior.from(V) ([original docs](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.html#from())) and then set the callback with behavior.setBottomSheetCallback() (original docs).