Android: how to use the current theme's colors in a drawable xml? Android: how to use the current theme's colors in a drawable xml? xml xml

Android: how to use the current theme's colors in a drawable xml?


You can use this attribute to get color from currently used theme:

android:color="?colorPrimary"

This is possible only for android 5.0 or higher.