Android examples for Graphics:Gradient Color
create GradientDrawable from content color, stroke color, radius
//package com.java2s; import android.graphics.drawable.GradientDrawable; public class Main { public static GradientDrawable createDrawable(int contentColor, int strokeColor, int radius) { GradientDrawable drawable = new GradientDrawable(); drawable.setGradientType(GradientDrawable.RECTANGLE); drawable.setColor(contentColor);// drawable.setStroke(1, strokeColor); // ,ViewsetScrollCache(false) drawable.setCornerRadius(radius); // return drawable; }/*from w w w. j a v a 2s . c o m*/ }