title: android onclick for swipe layout in recyclerview
body: <p>I attached <code>simpleItemTouchCallback</code> to <code>recyclerView</code> for  swiping items in the list. </p>
  
  <pre><code>              @Override
                public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
                      if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
                          View itemView = viewHolder.itemView;
                          float height = (float) itemView.getBottom() - (float) itemView.getTop();
                          float width = height / 3;
                          if (dX / 3 &gt; 0) {
                              RectF rect = new RectF((float) itemView.getLeft(), (float) itemView.getTop(), dX / 3, (float) itemView.getBottom());
                              LayoutInflater li = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                              View v = li.inflate(R.layout.complete_layout, null);
                              v.measure(View.MeasureSpec.getSize(v.getMeasuredWidth()), View.MeasureSpec.getSize(v.getMeasuredHeight()));
                              v.layout(0, 0, Math.round(rect.width()), Math.round(rect.height()));
                              c.save();
                              c.translate(rect.left, rect.top);
                              v.draw(c);
                          } else {
                              RectF rect1 = new RectF((float) itemView.getRight() + dX / 3, (float) itemView.getTop(), (float) itemView.getRight(), (float) itemView.getBottom());
                              LayoutInflater li1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                              View v = li1.inflate(R.layout.delete_layout, null);
                              v.measure(View.MeasureSpec.getSize(v.getMeasuredWidth()), View.MeasureSpec.getSize(v.getMeasuredHeight()));
                              v.layout(0, 0, Math.round(rect1.width()), Math.round(rect1.height()));
                              c.save();
                              c.translate(rect1.left, rect1.top);
                              v.draw(c);
                          }
                          c.restore();
                      }
   super.onChildDraw(c, recyclerView, viewHolder, dX / 3, dY, actionState, isCurrentlyActive);
  </code></pre>
  
  <p>Swiping and drawing new layout is working properly. Now want add an <code>OnClickListener</code> to the new layout. I couldn't find a way to do so. </p>