0

I want to make a drawable like this : enter image description here

this is my code so far:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <corners android:topLeftRadius="10dp"
                android:topRightRadius="5dp"
                android:bottomLeftRadius="15dp"
                android:bottomRightRadius="20dp" />
            <solid android:color="@color/red_home" />

        </shape>
    </item>
    <item>
        <shape android:shape="rectangle" >
            <corners android:topLeftRadius="100dp"
                android:topRightRadius="0dp"
                android:bottomLeftRadius="0dp"
                android:bottomRightRadius="0dp" />
            <solid android:color="@color/green2" />
        </shape>
    </item>
</layer-list>

enter image description here

It's not how I wanted it to be ... I don't want the radius in the top left corner... how can I make it like the first image ?

Navid Abutorab
  • 1,667
  • 7
  • 31
  • 58
  • 2
    Radius will not work for you because your image has straight line, i suggest you can rotate your shape – Ashvin solanki Jun 13 '22 at 05:13
  • 1
    Radius is for curves. If you wanted a rounded corner for a button, you'd use that. I wouldn't use a shape drawable for this, I'd use a vector drawable. Really there's very few reasons to use shapes now that vector is supported. – Gabe Sechan Jun 13 '22 at 05:17
  • Create a svg file for this would be a better choice. – Sam Chen Jun 13 '22 at 16:57

0 Answers0