diff options
author | Chris Craik <ccraik@google.com> | 2014-05-23 17:55:03 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-05-28 13:35:10 -0700 |
commit | ab008f0c642461b033e6f7dd3edfc49a43fb6293 (patch) | |
tree | 29ac0346ed84a8035b9950c0568d3dbde9f77092 /tests | |
parent | dab839e0478559781fe703c83f4e8a43d34960d2 (diff) | |
download | frameworks_base-ab008f0c642461b033e6f7dd3edfc49a43fb6293.zip frameworks_base-ab008f0c642461b033e6f7dd3edfc49a43fb6293.tar.gz frameworks_base-ab008f0c642461b033e6f7dd3edfc49a43fb6293.tar.bz2 |
Respect Z ordering in touch dispatch, software drawing
bug:14390526
Change-Id: I617a6ea7dbac1facae246491a247cf307452fc0e
Diffstat (limited to 'tests')
4 files changed, 68 insertions, 11 deletions
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml index db802c5..6b70631 100644 --- a/tests/HwAccelerationTest/AndroidManifest.xml +++ b/tests/HwAccelerationTest/AndroidManifest.xml @@ -902,5 +902,14 @@ <category android:name="com.android.test.hwui.TEST" /> </intent-filter> </activity> + + <activity + android:name=".ZOrderingActivity" + android:label="Reordering/Z Ordering"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="com.android.test.hwui.TEST" /> + </intent-filter> + </activity> </application> </manifest> diff --git a/tests/HwAccelerationTest/res/layout/z_ordering.xml b/tests/HwAccelerationTest/res/layout/z_ordering.xml new file mode 100644 index 0000000..970c5fd --- /dev/null +++ b/tests/HwAccelerationTest/res/layout/z_ordering.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:id="@+id/parent"> + <RelativeLayout + android:layout_width="400dp" + android:layout_height="200dp" + android:layout_weight="1" + android:orientation="vertical"> + <TextView style="@style/TopLeftReorderTextView"/> + <TextView style="@style/BottomLeftReorderTextView"/> + <TextView style="@style/TopRightReorderTextView"/> + <TextView style="@style/BottomRightReorderTextView"/> + </RelativeLayout> +</LinearLayout>
\ No newline at end of file diff --git a/tests/HwAccelerationTest/res/values/styles.xml b/tests/HwAccelerationTest/res/values/styles.xml index cde5d20..108709b 100644 --- a/tests/HwAccelerationTest/res/values/styles.xml +++ b/tests/HwAccelerationTest/res/values/styles.xml @@ -1,34 +1,37 @@ <resources> <style name="ReorderTextView" parent="@android:style/TextAppearance.Medium"> - <item name="android:layout_width">match_parent</item> + <item name="android:background">@drawable/appwidget_background</item> + <item name="android:layout_width">300dp</item> <item name="android:layout_height">100dp</item> <item name="android:gravity">center</item> </style> <style name="LeftReorderTextView" parent="@style/ReorderTextView"> - <item name="android:translationX">20dp</item> + <item name="android:translationX">50dp</item> + <item name="android:layout_alignParentLeft">true</item> </style> <style name="RightReorderTextView" parent="@style/ReorderTextView"> - <item name="android:translationX">-20dp</item> + <item name="android:translationX">-50dp</item> + <item name="android:layout_alignParentRight">true</item> </style> <style name="TopLeftReorderTextView" parent="@style/LeftReorderTextView"> - <item name="android:background">#666</item> - <item name="android:text">100</item> - <item name="android:translationZ">100dp</item> + <item name="android:text">200</item> + <item name="android:translationZ">200dp</item> + <item name="android:layout_alignParentTop">true</item> </style> <style name="BottomLeftReorderTextView" parent="@style/LeftReorderTextView"> - <item name="android:background">#bbb</item> <item name="android:text">300</item> <item name="android:translationZ">300dp</item> + <item name="android:layout_alignParentBottom">true</item> </style> <style name="TopRightReorderTextView" parent="@style/RightReorderTextView"> - <item name="android:background">#888</item> - <item name="android:text">200</item> - <item name="android:translationZ">200dp</item> + <item name="android:text">100</item> + <item name="android:translationZ">100dp</item> + <item name="android:layout_alignParentTop">true</item> </style> <style name="BottomRightReorderTextView" parent="@style/RightReorderTextView"> - <item name="android:background">#ccc</item> <item name="android:text">400</item> <item name="android:translationZ">400dp</item> + <item name="android:layout_alignParentBottom">true</item> </style> </resources> diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java new file mode 100644 index 0000000..45e77ed --- /dev/null +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java @@ -0,0 +1,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); + } + } + } +} |