I assume you are switched, but you can do this using vector drawings .
The following is not clear (the line is not completely straight), but you should start well:
New XML file:
<?xml version="1.0" encoding="utf-8"?> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="100dp" android:width="100dp" android:viewportHeight="100" android:viewportWidth="100"> <path android:name="dark_triangle" android:fillColor="@color/blue" android:pathData="M 0,100 L 0,80 60,70 100,80 100,100 z" /> <path android:name="light_triangle" android:fillColor="@color/color_light_blue" android:pathData="M 60,70 L 100,65 100,80 z" /> </vector>
In your layout:
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" app:srcCompat="@drawable/test" />
You may also need to add this to your layout:
xmlns:app="http://schemas.android.com/apk/res-auto"
Notes:
Mikel source share