Creating a layer-list using a predefined shape drawable
===

I'm trying to create a custom shape which is made up of a few smaller squares using a layer-list.

My questions are: 

1. Is there a way to define the size of the inner squares without using a bitmap that is already set to a specific size?

2. Is it possible to centre the inner squares of the layer-list?

I had a look through the documentation but didn't find a way to do it.

More information:

This is an example of what I would like to achieve using a layer-list:

![layer-list-example][1]


  [1]: http://i.stack.imgur.com/FCUZO.png
Each inner square is predefined in a file called "square_box.xml" using a simple shape definition.

As an example, I would like to be able to call my layer-list (say layered_box.xml) like this:

	<View 
	    android:background="@drawable/layered_box"
	    android:layout_width="match_parent"
	    android:layout_height="60dp" />

Each inner square would be 50dp by 50dp, centered with a margin of 5dp in the layer-list.

Is this possible?

In my own attempts I have not found a way to define the size of the inner squares so they just stretch to the size of the view. In the android documentation they mentioned  using bitmap to achieve this, but that would require me to actually use an image file instead of a shape xml file. They also don't mention anything about centring items in the layer-list.

I can achieve this quite simply by using a relative or linear layout and just adding a view for each of the inner squares in the correct locations, but that seems messy. I guess a third question I have is: if the above is not possible, should I do it using layouts? Or is there a better way?

Thanks!