FileDocCategorySizeDatePackage
GridLayoutTest.javaAPI DocAndroid 5.1 API2046Thu Mar 12 22:22:44 GMT 2015com.android.test.layout

GridLayoutTest

public class GridLayoutTest extends AbstractLayoutTest

Fields Summary
Constructors Summary
Methods Summary
public android.view.ViewGroupcreate(android.content.Context context)

        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;
    
public java.lang.Stringtag()

        return GridLayoutTest.class.getName();