get GradientDrawable - Android Graphics

Android examples for Graphics:Gradient Drawable

Description

get GradientDrawable

Demo Code


//package com.java2s;

import android.graphics.drawable.GradientDrawable;

public class Main {

    public static GradientDrawable getGradientDrawable(float radius,
            int argb) {
        GradientDrawable drawable = new GradientDrawable();
        drawable.setCornerRadius(radius);
        drawable.setColor(argb);/* w  w  w  . jav  a2  s  .c  om*/
        drawable.setShape(GradientDrawable.RECTANGLE);
        return drawable;
    }
}

Related Tutorials