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

U Gotta Love Yourself

Taking Flight

Unconditional Love