title: Swipe and OnClick events in RecyclerView
body: <p>I'm trying to implement a swipe to dismiss action in a RecyclerView but when I set an OnClickListener on any View in a ViewHolder it overrides all OnTouch events on that view.</p>
  
  <p>I can abandon OnClickListener and handle all clicks in the TouchListener but if I have multiple buttons in a child view of the RecycleView than that will be a lot of code and this doesn't look like a right way.</p>
  
  <p>In my RecyleView I'm setting Swipe to dismiss listeners (<a href="https://github.com/romannurik/Android-SwipeToDismiss">similar to this</a>):</p>
  
  <pre><code>    setOnTouchListener(touchListener);
      setOnScrollListener(touchListener.makeScrollListener());
  </code></pre>
  
  <p>It works in the ListView, but in the RecycleView the OnClickListener blocks OnTouchListner events.</p>
  
  <p>Example of the layout for ViewHolder view.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/card_title"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:minHeight="72dp"
  android:descendantFocusability="blocksDescendants"&gt;
  
  &lt;ImageView
      android:id="@+id/keep_icon"
      android:layout_width="48dp"
      android:layout_height="48dp"
      android:layout_centerInParent="true"
      android:src="@drawable/ic_received" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>Inflating in the RecyclerView.Adapter:</p>
  
  <pre><code>@Override
  public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = mInflater.inflate(R.layout.push_card_view_compat, viewGroup, false);
      return new ViewHolder(v, onClickListener, onKeepListener);
  }
  </code></pre>
  
  <p>The ViewHolder:</p>
  
  <pre><code>public ViewHolder(final View itemView,
                    final OnViewHolderClickListener onClickListener,
                    final OnKeepListener onKeepListener) {
      super(itemView);
      keepButton = (ImageView) itemView.findViewById(R.id.keep_icon);
  
      itemView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          onItemClickListener.onClick(getPosition(), itemView);
      }
      });
      keepButton.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          onKeepListener.onClick(getPosition(), itemView);
      }
      });
  }
  </code></pre>