Essential Android VectorDrawable and AnimatedVectorDrawable edit forum

Using clip-path

A defines a shape which acts as a window, only allowing parts of a to show if they are within the shape and cutting off the rest.

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <clip-path
        android:name="square clip path"
        android:pathData="M6,6 h12 v12 h-12 z"/>
    <path
        android:name="triangle"
        android:fillColor="#FF000000"
        android:pathData="M0,24 l12,-24 l12,24 z"/>

</vector>

In this case the produces a black triangle, but the defines a smaller square shape, only allowing part of the triangle to show through:


Table Of Contents
39 ACRA
52 VectorDrawable and AnimatedVectorDrawable
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close