Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw android xml shape diagonal with triangles

Hi I would like to draw something like this

Diagonal

with a shape Is it possible ?

like image 741
Pauli Avatar asked Oct 01 '15 09:10

Pauli


1 Answers

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>
like image 133
rupesh Avatar answered Sep 23 '22 10:09

rupesh