title: Android Recyclerview Multiple onclick items
body: <p>I am trying to have a recyclerview where each item is a simple TextView + Checkbox</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal" android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/title"
      android:layout_width="0dp"
      android:layout_weight="5"
      android:layout_height="wrap_content"
      /&gt;
  &lt;CheckBox
      android:id="@+id/chk"
      android:layout_width="0dp"
      android:layout_weight="1"
      android:layout_height="wrap_content" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>What I am trying to achieve is to (un)check the checkbox if it is clicked. But if the textview is clicked, then do the ripple animation on the entire item and start a fragment transition.</p>
  
  <p>I couldn't find an example online and the closest that I found was <a href="https://stackoverflow.com/questions/24471109/recyclerview-onclick">RecyclerView onClick</a></p>
  
  <p>I managed to get the onclick to function however, in the code </p>
  
  <pre><code>@Override public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) {
  View childView = view.findChildViewUnder(e.getX(), e.getY());
  if (childView != null &amp;&amp; mListener != null &amp;&amp; mGestureDetector.onTouchEvent(e)) {
    mListener.onItemClick(childView, view.getChildPosition(childView));
    return true;
  }
  return false;
  </code></pre>
  
  <p>}</p>
  
  <p>The problem I have is that the childView returned is the linearlayout and not the textview or checkbox. I am thus unable to determine whether the click was done on the textview or the checkbox.</p>
  
  <p>Is there something that I am missing? Ideally if someone has a working example of how to implement this, that would be great.</p>
  
  <p>Thanks.</p>