Closed gokulkrizh closed 4 years ago
can you format this better and provide more details?
I believe this is intended - we don't currently support nested recyclerviews, but it is being worked on
Great. Thanks @elihart for super fast response is there any way to find the position of the carousel while scrolling. i tried with linearlayoutmanager to get position but ended up with 0 for findFirstCompletelyVisibleItemPosition, findFirstVisibleItemPosition, findLastCompletelyVisibleItemPosition, findLastVisibleItemPosition all methods
private fun initEpoxy(images: MutableList<Images>) { mBinding.recyclerView.withModels { imageCarousel { id("Carousel") padding(Carousel.Padding(0, 0, 0, 0, 10)) setDefaultGlobalSnapHelperFactory(object : Carousel.SnapHelperFactory() { override fun buildSnapHelper(context: Context?): SnapHelper { return PagerSnapHelper() } }) withModelsFrom(images){ ViewholderListingDetailsPhotoStoryBindingModel_() .id(it.id()) .url(it.name()) .onVisibilityChanged { model, view, percentVisibleHeight, percentVisibleWidth, heightVisible, widthVisible -> } .onVisibilityStateChanged { model, view, visibilityState -> } } } } }
@ModelView(saveViewState = true, autoLayout = ModelView.Size.MATCH_WIDTH_MATCH_HEIGHT) class ImageCarousel(context: Context) : Carousel(context) { @NonNull override fun createLayoutManager(): RecyclerView.LayoutManager { return LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) } }