FileDocCategorySizeDatePackage
VectorDrawable01.javaAPI DocAndroid 5.1 API2635Thu Mar 12 22:22:44 GMT 2015com.android.test.dynamic

VectorDrawable01

public class VectorDrawable01 extends android.app.Activity

Fields Summary
private static final String
LOGCAT
int[]
icon
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)


    
        
        super.onCreate(savedInstanceState);
        GridLayout container = new GridLayout(this);
        container.setColumnCount(5);
        container.setBackgroundColor(0xFF888888);
        final Button []bArray = new Button[icon.length];

        for (int i = 0; i < icon.length; i++) {
            Button button = new Button(this);
            bArray[i] = button;
            button.setWidth(200);
            button.setBackgroundResource(icon[i]);
            container.addView(button);
            VectorDrawable vd = (VectorDrawable) button.getBackground();
            vd.setAlpha((i + 1) * (0xFF / (icon.length + 1)));
        }

        setContentView(container);