Starting Android API 24, custom Drawables classes can be used in XML only within your package.
Custom drawables classes may be used in XML in multiple ways:
Using the fully-qualified class name as the XML element name. For this method, the custom drawable class must be a public top-level class.
<com.yourapp.MyCustomDrawable
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#ffff0000"/>
Using drawable as the XML element name and specifying the fully-qualified class name from the class attribute. This method may be used for both public top-level classes and public static inner classes.
<drawable xmlns:android="http://schemas.android.com/apk/res/android"
class="com.myapp.MyTopLevelClass$InnerCustomDrawable"
android:color="#ffff0000" />
Note: that is not supported by support library.