title: Provide outline for rounded rectangle with varying corner radius to clip view in Android
body: <p>I'm trying to clip the child views of a ViewGroup using <code>ClipOutlineProvider</code>, but the parent view group needs to have its top two corners rounded with different radii (left corner: 36dp, right corner: 4dp) as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/NbTdg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NbTdg.png" alt="enter image description here"></a></p>
  
  <p>I've experimented with a custom <code>ClipOutlineProvider</code>, but couldn't get to clip the two corners with different radii. I only got as far as clipping all corners with the same radius. Code and result below:</p>
  
  <pre><code>private class ClipOutlineProvider extends ViewOutlineProvider {
  
      @Override
      public void getOutline(View view, Outline outline) {
          outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), Utils.dpToPixels(36));
      }
  
  }
  </code></pre>
  
  <p>I've added a background color to the RecyclerView item background here to ensure that clipping is applied to child views properly.</p>
  
  <p><a href="https://i.stack.imgur.com/geo3K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/geo3K.png" alt="enter image description here"></a></p>
  
  <p>Would appreciate any help in achieving this feat.</p>
  
  <p>P.S. Using a ShapeDrawable XML and setting <code>View.setClipToOutline()</code> to <code>true</code> didn't work either in this case.  </p>