Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eea9afe authored by Tenghui Zhu's avatar Tenghui Zhu Committed by Android (Google) Code Review
Browse files

Merge "Add test for AVD on SW Layer" into nyc-dev

parents b3eca316 06a353d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
    android:height="4dp"
    android:viewportHeight="4"
    android:viewportWidth="360"
    android:width="360dp" >
    android:width="36dp" >

    <group
        android:name="linear_indeterminate"
+21 −17
Original line number Diff line number Diff line
@@ -43,17 +43,20 @@ public class AnimatedVectorDrawableTest extends Activity implements View.OnClick

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        final int[] layerTypes = {View.LAYER_TYPE_SOFTWARE, View.LAYER_TYPE_HARDWARE};
        super.onCreate(savedInstanceState);

        ScrollView scrollView = new ScrollView(this);
        GridLayout container = new GridLayout(this);
        scrollView.addView(container);
        container.setColumnCount(1);
        container.setColumnCount(2);

        for (int i = 0; i < icon.length; i++) {
            for (int j = 0; j < layerTypes.length; j++) {
                Button button = new Button(this);
                button.setWidth(400);
                button.setHeight(400);
                button.setLayerType(layerTypes[j], null);
                button.setBackgroundResource(icon[i]);
                AnimatedVectorDrawable d = (AnimatedVectorDrawable) button.getBackground();
                d.registerAnimationCallback(new Animatable2.AnimationCallback() {
@@ -71,6 +74,7 @@ public class AnimatedVectorDrawableTest extends Activity implements View.OnClick
                container.addView(button);
                button.setOnClickListener(this);
            }
        }

        setContentView(scrollView);
    }