Draw android xml shape diagonal with triangles

Pauli picture Pauli · Oct 1, 2015 · Viewed 7.5k times · Source

Hi I would like to draw something like this

Diagonal

with a shape Is it possible ?

Answer

rupesh picture rupesh · Oct 13, 2018

I know its too late to answer this question but still posting my answer here so that others can have reference:

<?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="#FFFFFF"
    android:pathData="M 100,0 L 0,100 100,100 z" />

<path
    android:name="light_triangle"
    android:fillColor="#d0021b"
    android:pathData="M 0,0 L 100,0 0,100 z" />

</vector>