Java tutorial
//package com.java2s; import android.graphics.drawable.GradientDrawable; public class Main { public static GradientDrawable getDrawable(int radius, int fillColor, int width, int strokeColor) { GradientDrawable gradientDrawable = new GradientDrawable(); gradientDrawable.setCornerRadius(radius); gradientDrawable.setColor(fillColor); gradientDrawable.setStroke(width, strokeColor); return gradientDrawable; } }