title: Getting the visible item inside the RecyclerView
body: <p>I'm using the code as below to get the visible item inside the recyclerview</p>
  
  <p>In side my Fragment activity I have:</p>
  
  <pre><code>layoutmanager = new LinearLayoutManager(Activity);
  
          adapter = new FeedAdapter(vid, userName, this.Context);
  
          feeditem.SetLayoutManager(layoutmanager);
          feeditem.SetAdapter(adapter);
  
          var onScrollListener = new XamarinRecyclerViewOnScrollListener(Activity, layoutmanager, adapter);
  
          feeditem.AddOnScrollListener(onScrollListener);
  </code></pre>
  
  <p>and the event handler class looks like this:</p>
  
  <pre><code>public class XamarinRecyclerViewOnScrollListener : RecyclerView.OnScrollListener
  {
      public delegate void LoadMoreEventHandler(object sender, EventArgs e);
  
      public event LoadMoreEventHandler LoadMoreEvent;
  
      private LinearLayoutManager layoutmanager;
  
      private Action StateChange;
  
      private FeedAdapter adapter;
  
      private View currentFocusedLayout, oldFocusedLayout;
  
      private Context ctx;
  
      public XamarinRecyclerViewOnScrollListener(LinearLayoutManager layoutManager)
      {
          this.layoutmanager = layoutManager;
      }
  
      public XamarinRecyclerViewOnScrollListener(Context ctx, LinearLayoutManager layoutmanager, FeedAdapter adapter)
      {
          // TODO: Complete member initialization
          this.layoutmanager = layoutmanager;
  
          this.adapter = adapter;
  
          this.ctx = ctx;
  
          //this.StateChange = StateChange;
      }
  
      public override void OnScrollStateChanged(RecyclerView recyclerView, int newState)
      {
          base.OnScrollStateChanged(recyclerView, newState);
  
          if (newState == (int)ScrollState.Idle)
          {
              layoutmanager = (LinearLayoutManager)recyclerView.GetLayoutManager();
  
              int firstVisiblePosition = layoutmanager.FindFirstCompletelyVisibleItemPosition();
  
              if (firstVisiblePosition &gt;= 0)
              {
                  if (oldFocusedLayout != null)
                  {
                      Toast.MakeText(ctx, "Stop Video", ToastLength.Long).Show();
                  }
  
  
              }
              currentFocusedLayout = layoutmanager.FindViewByPosition(firstVisiblePosition);
              //VideoView vv_dashboard = (VideoView)currentFocusedLayout.findViewById(R.id.vv_dashboard);
              ////to play video of selected recylerview, videosData is an array-list which is send to recyclerview adapter to fill the view. Here we getting that specific video which is displayed through recyclerview.
              //playVideo(videosData.get(positionView));
  
              Toast.MakeText(ctx, "Play video", ToastLength.Long).Show();
  
              oldFocusedLayout = currentFocusedLayout;
  
          }
      }
  }
  </code></pre>
  
  <p><code>layoutmanager.FindFirstCompletelyVisibleItemPosition()</code> always returns -1. I wanna setect the item on the list that is visible on the screen and then do something with it. I have tried different solutions but none of them worked. What's the right way of achieving this?</p>