Home » Android » android – Using parents for drawable resources

android – Using parents for drawable resources

Posted by: admin May 14, 2020 Leave a comment

Questions:

When I define a style, it can be inherited from a parent style, e.g:

<style name="DialogNoTitle" parent="@android:style/Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
</style>

Now I want to do the same with drawable resources, something like this:

<shape xmlns:android="http://schemas.android.com/apk/res/android" name="ChildDrawable" parent="@drawable/ParentDrawable">
    <solid android:color="@android:color/white"/>
    <corners android:radius="6dp"/>
</shape>

Is there a way to accomplish this functionality?

How to&Answers:

Short answer – you cannot extend and override drawables. However,