GridLayout container = new GridLayout(context);
container.setOrientation(VERTICAL);
// container.setUseDefaultMargins(true);
for (int i = 0; i < VERTICAL_ALIGNMENTS.length; i++) {
int va = VERTICAL_ALIGNMENTS[i];
for (int j = 0; j < HORIZONTAL_ALIGNMENTS.length; j++) {
int ha = HORIZONTAL_ALIGNMENTS[j];
Spec rowSpec = spec(UNDEFINED, null);
Spec colSpec = spec(UNDEFINED, null);
GridLayout.LayoutParams lp = new GridLayout.LayoutParams(rowSpec, colSpec);
//GridLayout.LayoutParams lp = new GridLayout.LayoutParams();
lp.setGravity(va | ha);
View v = create(context, VERTICAL_NAMES[i] + "-" + HORIZONTAL_NAMES[j], 20);
container.addView(v, lp);
}
}
return container;