新しいクラスを追加し、Buttonを拡張してから、必要に応じてメソッドをオーバーライドします:)
私の場合、setBackgroundDrawable()をオーバーライドします
@Override
public void setBackgroundDrawable(Drawable background) {
Log.d("button","setting new background ");
Drawable[] layers = new Drawable[5];
Resources resources = getResources();
layers[0] = resources.getDrawable(R.drawable.outer_rectangle);
layers[1] = resources.getDrawable(R.drawable.inner_rectangle);
layers[2] = resources.getDrawable(R.drawable.upper_ovel);
layers[3] = resources.getDrawable(R.drawable.gradient_fill);
layers[4] = resources.getDrawable(R.drawable.lower_ovel);
LayerDrawable layerDrawable = new LayerDrawable(layers);
layerDrawable.setLayerInset(0, 0, 0, 0, 0);
layerDrawable.setLayerInset(1, 3, 3, 3, 0);
layerDrawable.setLayerInset(2, 3, 15, 3, 25);
layerDrawable.setLayerInset(3, 3, 23, 3, 0);
layerDrawable.setLayerInset(4, 4, 60, 4, -5);
super.setBackgroundDrawable(layerDrawable);
}