I have created the custom shape in android project. here is code,
curvedShape.xml:-
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="4dp" android:color="#ffffff" />
<padding android:left="7dp" android:top="7dp"
android:right="7dp" android:bottom="7dp" />
<gradient android:centerColor="#ffffff" android:startColor="#32CD32" android:endColor="#ffffff"/>
</shape>
main.xml:-
<View
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginLeft = "10dp"
android:layout_marginRight = "10dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@drawable/curvedshape"/>
In shape,gradient attribute gave start color as green, that filled green color vertically. but i want to fill the color like the below image, fill color in horizontal in half shape.
How to do that?

Use layer-list and draw two shapes in XML:
Edits :
you have just use this gradient attribute in your xml
I have use this and this show similar shape required by you: