Reputation: 137
How do I create a drawable like this?
Upvotes: 0
Views: 4619
Reputation: 21
Instead of slating the right side, I have slanted the left side, however you can use this logic
***
<!-- Colored rectangle-->
<item>
<shape android:shape="rectangle">
<padding android:top="35dp"/>
<size android:width="200dp"
android:height="40dp" />
<solid android:color="#13a89e" />
</shape>
</item>
<!-- This rectangle for the left side -->
<item
android:right="200dp"
android:left="-200dp"
android:top="-200dp"
android:bottom="-200dp">
<rotate android:fromDegrees="-45">
<shape android:shape="rectangle">
<padding android:top="-35dp"/>
<solid android:color="#ffffff" />
</shape>
</rotate>
</item>
*** Hope this one helps
Upvotes: 0
Reputation: 624
The search keyword is: "Android how to create custom shapes".
You will find many examples. For example this one.
If you image that shape what you want is a regular rectangle + a triangle you get the result from the link provided, just have to adapt the parameters.
I hope is helpfully!
Upvotes: 1