and roid shape setCornerRadii

Java
    float mRadius=3f;

    GradientDrawable drawable=new GradientDrawable();
    drawable.setShape(GradientDrawable.RECTANGLE);
    drawable.setCornerRadii(new float[]{mRadius, mRadius, 0, 0, 0, 0, mRadius, mRadius});
Source

Also in Java: