public override void OnScrollStateChanged(RecyclerView recyclerView, int newState) { base.OnScrollStateChanged(recyclerView, newState); ScrollState listViewState = newState switch { RecyclerView.ScrollStateDragging => ScrollState.TouchScroll, RecyclerView.ScrollStateIdle => ScrollState.Idle, RecyclerView.ScrollStateSettling => ScrollState.Fling, _ => ScrollState.TouchScroll }; scrollListener.OnScrollStateChanged(null /*view*/, listViewState); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public final void onScrollStateChanged(final android.widget.AbsListView view, final int state) public void OnScrollStateChanged(AbsListView view, ScrollState state) { /// <summary> /// Check that the scrolling has stopped, and that the last item is /// visible. /// </summary> if (state == ScrollState.Idle && null != mOnLastItemVisibleListener && mLastItemVisible) { mOnLastItemVisibleListener.onLastItemVisible(); } if (null != mOnScrollListener) { mOnScrollListener.OnScrollStateChanged(view, state); } }
public override void OnScrollStateChanged(RecyclerView recyclerView, int newState) { base.OnScrollStateChanged(recyclerView, newState); ScrollState listViewState = ScrollState.TouchScroll; //wael; switch (newState) { case RecyclerView.ScrollStateDragging: listViewState = ScrollState.TouchScroll; break; case RecyclerView.ScrollStateIdle: listViewState = ScrollState.Idle; break; case RecyclerView.ScrollStateSettling: listViewState = ScrollState.Fling; break; } scrollListener.OnScrollStateChanged(null /*view*/, listViewState); }