Am trying to make a custom drawable using xml, like the attached image
Below are two approach i have done,
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorAccent" />
<stroke
android:width="2dp"
android:color="@color/colorAccent" />
<gradient
android:angle="135"
android:endColor="#000"
android:startColor="#ffff"
android:type="linear" />
</shape>
By doing like this i can get the effect right, but the colors seems to be merged, I want two colors without any merge effect, then i tried like this,
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white">
<shape android:shape="oval">
<corners android:radius="@dimen/size_30dp" />
</shape>
</item>
<item>
<rotate
android:fromDegrees="35"
android:pivotX="0%"
android:pivotY="100%">
<shape android:shape="rectangle">
<solid android:color="@color/textColorGreyExtraLight" />
</shape>
</rotate>
</item>
</layer-list>
This approach actually messed up the UI, also i have compromise on the rounded edges,
So i there any way i can draw this effect using XML?
Any kind of help will be greatly appreciated.
FYI The width and height of drawable will vary, so the diagonal should be always left bottom edge to right top edge.
Thanks