Search code examples
androidandroid-drawable

Android - how to make inner rounded corner like a paper tag?


enter image description here

i would like to draw the following image but im confused on how to do the beginning area that i put in orange. i want that to be circular but its a inner circle if you see what i mean from the photo. i tried using a negative radius like this:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="rectangle">
  <solid android:color="@color/my_green" />
  <corners android:radius="-24dp" />
</shape>

but that does not do anything. how is this accomplished ?

p.s it does not have to be in orange can be all the same color i just wanted to emphasis the issue.


Solution

  • i used a layer list with two drawables. make a white drawable with circular shape. just shift that drawables over a bit and ensure its a solid white color. it will give the effect as above.