public override void OnScrolled(RecyclerView recyclerView, int dx, int dy) { base.OnScrolled(recyclerView, dx, dy); if (_carouselView.Loop) { //We could have a race condition where we are scrolling our collection to center the first item //We save that ScrollToEventARgs and call it again _carouselViewLoopManager.CheckPendingScrollToEvents(recyclerView); } }
void LayoutReady(object sender, EventArgs e) { if (!_initialized) { ItemsView.Scrolled += CarouselViewScrolled; if (Carousel.Loop) { _carouselViewLoopManager.CenterIfNeeded(this, IsHorizontal); _carouselViewLoopManager.CheckPendingScrollToEvents(this); } _initialized = true; _isVisible = ItemsView.IsVisible; } UpdatePositionFromVisibilityChanges(); UpdateVisualStates(); }