From 953aeb32ea5094969b5d26ca9e6606334fcb948d Mon Sep 17 00:00:00 2001 From: Kevin Gorham Date: Thu, 27 Aug 2020 20:20:27 -0400 Subject: [PATCH] Allow color resources to be used in vector drawables. Without these changes, hard coded colors must be used on APIs prior to 24. --- app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 355ef18..db5aed7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,6 +27,10 @@ android { testInstrumentationRunnerArguments clearPackageData: 'true' multiDexEnabled true resValue 'string', 'bugsnag_api_key', "${(project.findProperty('BUGSNAG_API_KEY') ?: System.getenv('BUGSNAG_API_KEY')) ?: ''}" + + // this setting allows using color resources in vector drawables, rather than hardcoded values (note: only works when minApi is 21) + // per https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.VectorDrawablesOptions.html: If set to an empty collection, all special handling of vector drawables will be disabled. + vectorDrawables.generatedDensities = [] } flavorDimensions 'network' productFlavors {