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

AbstractLayoutTest

public abstract class AbstractLayoutTest extends android.app.Activity

Fields Summary
public static final String[]
HORIZONTAL_NAMES
public static final int[]
HORIZONTAL_ALIGNMENTS
public static final String[]
VERTICAL_NAMES
public static final int[]
VERTICAL_ALIGNMENTS
Constructors Summary
Methods Summary
public voidanimate(android.view.View v)

        long start = System.currentTimeMillis();
        int N = 1000;
        for (int i = 0; i < N; i++) {
            ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
            lp.topMargin = (lp.topMargin + 1) % 31;
            lp.leftMargin = (lp.leftMargin + 1) % 31;

            v.requestLayout();
            v.invalidate();
            ViewGroup p = (ViewGroup) v.getParent();
            p.layout(0, 0, 1000 + (i % 2), 500 + (i % 2));
        }
        Log.d(tag(), "Time: " + (float) (System.currentTimeMillis() - start) / N * 1000 + "mics");
    
public android.view.Viewcreate(android.content.Context context, java.lang.String name, int size)


            
        Button result = new Button(context);
        result.setText(name);
        result.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                animate(v);
            }
        });
        return result;
    
public abstract android.view.ViewGroupcreate(android.content.Context context)

protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(create(getBaseContext()));
    
public abstract java.lang.Stringtag()