title: TouchDelegate not receiving tap events correctly
body: <p>Edit: This problem was down to me passing the wrong view to the Touch Delegate...problem is resolved now....</p>
  
  <p>My <code>RelativeLayout</code> extension enlarges the clickable area of an <code>ImageView</code>. The RelativeLayout is the root <code>View</code> of the <code>ListView</code> row. The problem is when tapping areas that should be delegated to the <code>ImageView</code>, the <code>ListView</code>'s <code>onItemClicked</code> is triggered.</p>
  
  <p>My code is at the end and below is an image of what the extended bounds of the <code>ImageView</code> should be. If I tap on blue areas that are <em>not</em> the image, the click is received by the <code>ListView</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/JAuuY.png" alt="Blue areas indicate new bounds of the ImageView"></p>
  
  <pre><code>public class DelegatingRelativeLayout extends RelativeLayout {
  
  //relevant code moved to top
  @Override 
  protected void onLayout(boolean changed, int l, int t, int r, int b) {
      super.onLayout(changed, l, t, r, b);
  
      final float density = getContext().getResources().getDisplayMetrics().density;
      int extra = (int) (density * 4 + 0.5f);
  
      Rect rect = new Rect(0, 0, mEnlargedView.getWidth(), getHeight());
      rect.right += extra; //extend bounds by 4 pixels
      setTouchDelegate(new TouchDelegate(rect, mEnlargedView));
      mExtendedBounds = rect;
  }
  
  public void setEnlargedView(View v) {       
      mEnlargedView = v;
  }
  
  private static final boolean DEBUG_DRAW = true;
  
  private View mEnlargedView;
  private Rect mExtendedBounds;
  
  //constructors removed
  
  @Override
  protected void dispatchDraw(Canvas canvas) {
  
      if (DEBUG_DRAW) {
          Paint p = new Paint();
          p.setColor(Color.BLUE);
          canvas.drawRect(mExtendedBounds, p);
      }
  
      super.dispatchDraw(canvas);
  }
  
  }
  </code></pre>