trying to make a rectangular ShapeDrawable that has a rectangular cutout - it needs to actually be cutout so that the middle is 'transparent', it can't be a white rectangle on top of a larger nonwhite one or something like that.
Here's what I have so far (all that can be seen however is the top 'bar' of the rectangle, which oddly enough is black despite that being the color of the cutout):
PorterDuffColorFilter pd = new PorterDuffColorFilter(Color.BLACK, PorterDuff.Mode.SRC_OUT);
ShapeDrawable cutout = new ShapeDrawable();
cutout.setBounds(top.x, top.y, top.x+cellLength*matCols, top.y+cellLength*matRows);
cutout.setColorFilter(pd);
ShapeDrawable border = new ShapeDrawable();
border.setBounds(Math.round(top.x-thick*cellLength), Math.round(top.y-thick*cellLength), Math.round(top.x+cellLength*(matCols+thick)), Math.round(top.y+cellLength*(matRows+thick)));
LayerDrawable ogre = new LayerDrawable(new Drawable[]{cutout, border});
Button test = new Button(this.getContext());
test.setLayoutParams(new LayoutParams((int)Math.round(cellLength*(matCols + 2*thick)), (int)Math.round(cellLength*thick)));
test.setBackground(ogre);