title: Android View outline - using a custom Path
body: <p>When I set View's outline as follows it works just fine:</p>
  
  <pre><code>view.setClipToOutline(true);
  view.setOutlineProvider(new ViewOutlineProvider() {
    @Override
    public void getOutline(View view, Outline outline) {
      outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 16);
    }
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/W0dyj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/W0dyj.png" alt="enter image description here"></a></p>
  
  <p>However, using a <code>Path</code> has no effect. Replace <code>setRoundRect</code> with:</p>
  
  <pre><code>Path path = new Path();
  path.addRoundRect(
    0, 0, view.getWidth(), view.getHeight(), 16, 16, Path.Direction.CW);
  outline.setConvexPath(path);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5xAdZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5xAdZ.png" alt="enter image description here"></a></p>
  
  <p>How to make the view clip to the Path provided?</p>