title: RecyclerView fling and item click
body: <p>I have a <code>RecyclerView</code> that has a grid of items. Upon clicking on an item, it highlights.<br>
  I also want that when the user swipes right the a 'next' method is called, and when the user swipes left, a 'previous' method is called.<br>
  However, the two don't work out with each other, as each intercepts the other's events.<br>
  How do I get them to work together?  </p>
  
  <p>This is my code:</p>
  
  <p><strong>RecyclerView Adapter</strong></p>
  
  <pre><code>public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
      {
          myHolder = holder as MyView;
          myHolder.mMainView.SetOnClickListener(this);
          if (selected_position == position)
          {
              holder.ItemView.SetBackgroundColor(Color.LightGray);
          }
          else
          {
              holder.ItemView.SetBackgroundColor(Color.Transparent);
          }
     }
  
  public void OnClick(View v)
      {
          int position = mRecyclerView.GetChildLayoutPosition((View)sender);
  
          // Updating old as well as new positions
          NotifyItemChanged(selected_position);
          selected_position = position;
          NotifyItemChanged(selected_position);
      }
  </code></pre>
  
  <p><strong>Fragment that contains the RecyclerView</strong></p>
  
  <pre><code>calendarRecyclerView.SetOnTouchListener(this);
  
  public bool OnTouch(View v, MotionEvent e)
      {
          switch (e.Action)
          {
              case MotionEventActions.Down:
                  x1 = e.GetX();
                  break;
              case MotionEventActions.Up:
                  x2 = e.GetX();
                  float deltaX = x2 - x1;
                  if (Math.Abs(deltaX) &gt; MIN_DISTANCE)
                  {
                      // Left to Right swipe action
                      if (x2 &gt; x1)
                      {
                          NextMonth();
                      }
  
                      // Right to left swipe action               
                      else
                      {
                          PreviousMonth();
                      }
                  }
  
  
                  break;
          }
          return false;
      }
  </code></pre>
  
  <p>Because I put <code>return false</code> in the OnTouch event, the item's click event is fired. However, the MouseDown event doesn't fire in OnTouch, preventing swiping back detection (beacuse x1 is always 0).</p>