How can I create a shape in android like the image I added?
Aksukumar Maldeh
Jack'
I would use the gradient image from the drawable folder. Let's call it background.png. You can also do it with the icons searchicon.png and arrow.png
Then I will use the following code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@drawable/background">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:layout_marginBottom="10dp"
android:text="Current Location"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#ffffff"
android:textSize="20dp"
android:text="Mumbai"/>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:src="@drawable/arrow"/>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="50dp"
android:layout_marginEnd="50dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@drawable/searchicon"/>
</RelativeLayout>