コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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();
        }