Im trying to achieve something like this, I used layer list in the xml this way :
<item>
<shape android:shape="rectangle" >
<gradient
android:centerColor="#4DD0E1"
android:endColor="#76FF03"
android:startColor="@color/colorPrimary"
android:type="linear" />
</shape>
</item>
<item
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp">
<shape android:shape="rectangle" >
<solid android:color="#fff" />
</shape>
</item>
Here is the layout code, the border of the shape needs to overlap the image.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="12dp"
android:background="@android:color/transparent">
<ImageView
android:layout_width="100dp"
android:layout_height="75dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginRight="12dp"
android:id="@+id/goals_image" />
<FrameLayout
android:id="@+id/goals_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="32dp"
android:background="#00000000"
>
<TextView
android:id="@+id/goals_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15dp"
android:text="Lose Weight"
android:textColor="@color/black"
android:layout_margin="40dp"
/>
</FrameLayout>
</RelativeLayout>
but if I set the background to transparent the shapes background becomes the whole gradient color. How can i achieve a gradient stroke with a transparent background? Thanks in advance.