Update: I got Vector Drawables working on API Level pre-20 devices with teh following configuration.

build.gradle
vectorDrawables.useSupportLibrary = true

dependencies{classpath ‘com.android.tools.build:gradle:2.1.2’}

Activity
onCreate > AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

ImageView — XML
app:srcCompat=”@drawable/vector

ImageView — Programmatic
imageView.setBackgroundResource(R.vector);

vector.xml

`<vector xmlns:android=”http://schemas.android.com/apk/res/android"
android:width=”30dp”
android:height=”20dp”
android:viewportHeight=”20.0"
android:viewportWidth=”30.0">
<path
android:fillColor=”#4C5F70"
android:pathData=”DATA_HERE”
android:strokeColor=”#00000000"
android:strokeWidth=”1"/>
</vector>`

--

--

Open Sourcer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hurwitz

Adam Hurwitz

Open Sourcer

More from Medium

Everything Compiled: Assignment 1

Is the medium *really* more important than the message?

Dracula, Son of the Dragon

WHAT WAS IT LIKE WHEN YOU WERE A CHILD DURING THE PANDEMIC?