Android examples for Graphics:Drawable Operation
add Padding Around to Drawable
//package com.java2s; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; public class Main { public static Drawable addPaddingArround(int padding, Drawable drawable) { LayerDrawable withPadding = new LayerDrawable( new Drawable[] { drawable }); withPadding.setLayerInset(0, padding, padding, padding, padding); return withPadding; }/* w w w.jav a 2s .c om*/ }