summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
blob: 45e77edb03da269ee7f28f5b77109f5783312638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.android.test.hwui;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

public class ZOrderingActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.z_ordering);

        ViewGroup grandParent = (ViewGroup) findViewById(R.id.parent);
        if (grandParent == null) throw new IllegalStateException();
        View.OnClickListener l = new View.OnClickListener() {
            @Override
            public void onClick(View v) {}
        };
        for (int i = 0; i < grandParent.getChildCount(); i++) {
            ViewGroup parent = (ViewGroup) grandParent.getChildAt(i);
            for (int j = 0; j < parent.getChildCount(); j++) {
                parent.getChildAt(j).setOnClickListener(l);
            }
        }
    }
}