title: Custom ImageView is not showing images
body: <p>I am trying to implement an imageview with a diagonal cut at the bottom that I will user to display images on my app. This is the approach I take</p>
  
  <ol>
  <li>I create a custom class that extends the ImageView.</li>
  <li>I then override the onDraw method to draw the shape(This is where I'm not sure if I'm doing the correct thing</li>
  </ol>
  
  <blockquote>
    <p>My custom imageview class</p>
  </blockquote>
  
  <pre><code>public class DiagonalSquare extends ImageView {
  
  private Context mContext;
  Paint paint ;
  Path path;
  
  public DiagonalSquare(Context context, AttributeSet attrs) {
      super(context, attrs);
      this.mContext = context;
      setWillNotDraw(false);
      paint = new Paint(Paint.ANTI_ALIAS_FLAG);
  }
  
  @Override
  protected void onDraw(Canvas canvas) {
  
      int w = getWidth(), h = getHeight();
      paint.setStrokeWidth(2);
      paint.setColor(Color.WHITE);
      paint.setStyle(Paint.Style.FILL_AND_STROKE);
      paint.setAntiAlias(true);
  
      path = new Path();
      path.setFillType(Path.FillType.EVEN_ODD);
  
      path.moveTo(w,h*3/4);
      path.lineTo(w,h);
      path.lineTo(0,h);
      path.close();
      canvas.drawPath(path, paint);
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/m1sc9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m1sc9.png" alt="The result I end up getting"></a></p>
  
  <p>This is what I end up getting - blue section is the imageview. Here is the xml for that</p>
  
  <pre><code>  &lt;com.noel.CustomShape.DiagonalSquare
              android:id="@+id/background_image"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              android:scaleType="centerCrop"
              app:layout_collapseMode="parallax"
              android:src="@drawable/bebe" /&gt;
  </code></pre>