I have this shape defined in an xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:startColor="#FFFF0000"
        android:endColor="#80FF00FF"
        android:angle="45"/>
    <padding android:left="7dp" 
        android:top="7dp"
        android:right="7dp"
        android:bottom="7dp" />
    <corners
        android:bottomLeftRadius="5dp"    ##this need change
        android:bottomRightRadius="5dp"   ##this need change
        android:topLeftRadius="5dp"       ##this need change
        android:topRightRadius="5dp" />   ##this need change
</shape>

I am creating the following object:

Drawable shape = getResource().getDrawable(R.drawable.myshape);

and I need to modify its radius (or create one with another corner radius).

How can I change the radius? How can I create the shape programmatically?

Edit
Report