I have ImageButton on the layout of my application and I want to have rounded corners for this ImageButton, so I'm using style like:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="1dp"
android:color="@android:color/black" />
<corners android:radius="15dp" />
<solid android:color="@android:color/black"/>
</shape>
and then I'm using android:background="@drawable/my_rounded_shape.xml"/>
The problem is that after this I want to change background color from black to some custom color, but I can't modify style programmatically and there is no way to generate new style with corners but with different color and apply to my ImageButton.
Could you clarify is there any way to do it or any workaround?