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

Commit 1f12e831 authored by Teng-Hui Zhu's avatar Teng-Hui Zhu Committed by android-build-merger
Browse files

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

am: 5eea9afe

* commit '5eea9afe':
  Add test for AVD on SW Layer

Change-Id: Id6932e2d74f08f42997ed0cb0b6ebb508df164c0
parents cfc0818b 5eea9afe
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);
    }