コード例 #1
0
        private void Init()
        {
            _mChildrenHeights = new SparseIntArray();
            _mHeaderViewInfos = new List <FixedViewInfo>();
            _mFooterViewInfos = new List <FixedViewInfo>();
            base.SetClipChildren(false);

            ScrollStateChanged += (sender, args) =>
            {
                if (_mOriginalScrollListener != null)
                {
                    _mOriginalScrollListener.OnScrollStateChanged(args.View, args.ScrollState);
                }
            };

            Scroll += (sender, args) =>
            {
                if (_mOriginalScrollListener != null)
                {
                    _mOriginalScrollListener.OnScroll(args.View, args.FirstVisibleItem, args.VisibleItemCount, args.TotalItemCount);
                }
                // AbsListView#invokeOnItemScrollListener calls onScrollChanged(0, 0, 0, 0)
                // on Android 4.0+, but Android 2.3 is not. (Android 3.0 is unknown)
                // So call it with onScrollListener.
                OnScrollChanged();
            };
        }
コード例 #2
0
        public override void OnScrollStateChanged(Android.Support.V7.Widget.RecyclerView recyclerView, int newState)
        {
            ScrollState listViewState = ScrollState.Idle;

            switch (newState)
            {
            case ScrollStateDragging:
                listViewState = ScrollState.TouchScroll;
                break;

            case ScrollStateIdle:
                listViewState = ScrollState.Idle;
                break;

            case ScrollStateSettling:
                listViewState = ScrollState.Fling;
                break;
            }

            _scrollListener.OnScrollStateChanged(null, listViewState);
        }