summaryrefslogtreecommitdiff
path: root/android/testData/guiTests/LayoutTest/app/src/main/res
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-10 17:24:00 -0700
committerTor Norbye <tnorbye@google.com>2014-09-10 17:42:20 -0700
commit3805346d0e2111ca00682bdf6f9b2ba873fb923d (patch)
treeb491e8498378d40192a22a55305e78e18f118062 /android/testData/guiTests/LayoutTest/app/src/main/res
parent5d30b61ba110db9802f8d6e48b1461da51c824b5 (diff)
downloadidea-3805346d0e2111ca00682bdf6f9b2ba873fb923d.tar.gz
Layout UI test improvements
This CL improves the unit tests for layout rendering a bit (there are now simpler ways to assert the resource folder for the current layout, and a simpler way to track subsequent render updates). It also adds a base LayoutTest test project where we can check in more complicated layouts for use by layout tests, and finally this CL adds a layout rendering test which exercises the configuration switcher a bit more, checking that the preferred device list is working correctly. Change-Id: I78bbd70e36d4bf7c8d8c61fdfb42a7fdee96d1f0
Diffstat (limited to 'android/testData/guiTests/LayoutTest/app/src/main/res')
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/drawable/ic_launcher.xml1
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout-land/layout2.xml10
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout-sw600dp/layout2.xml10
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout-xlarge/layout2.xml10
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout/activity_my.xml16
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout/inner.xml7
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout/layout2.xml10
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/layout/outer.xml13
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/menu/my.xml9
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/values-w820dp/dimens.xml6
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/values/dimens.xml5
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/values/strings.xml9
-rw-r--r--android/testData/guiTests/LayoutTest/app/src/main/res/values/styles.xml8
13 files changed, 114 insertions, 0 deletions
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/drawable/ic_launcher.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/drawable/ic_launcher.xml
new file mode 100644
index 00000000000..04dae531a17
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/drawable/ic_launcher.xml
@@ -0,0 +1 @@
+<color xmlns:android="http://schemas.android.com/apk/res/android" android:color="#ff0000" /> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout-land/layout2.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-land/layout2.xml
new file mode 100644
index 00000000000..3c64480286e
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-land/layout2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="Layout 2, landscape folder"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout-sw600dp/layout2.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-sw600dp/layout2.xml
new file mode 100644
index 00000000000..1f4da867fee
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-sw600dp/layout2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="Layout 2, sw600dp"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout-xlarge/layout2.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-xlarge/layout2.xml
new file mode 100644
index 00000000000..4ced381d226
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout-xlarge/layout2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="Layout 2, xlarge folder"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout/activity_my.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/activity_my.xml
new file mode 100644
index 00000000000..c17166f4d34
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/activity_my.xml
@@ -0,0 +1,16 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ tools:context=".MyActivity">
+
+ <TextView
+ android:text="@string/hello_world"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+</RelativeLayout>
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout/inner.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/inner.xml
new file mode 100644
index 00000000000..0951f220a95
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/inner.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Inner layout"
+ tools:showIn="@layout/outer" /> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout/layout2.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/layout2.xml
new file mode 100644
index 00000000000..f3565c002e3
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/layout2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="Layout 2, base folder"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/layout/outer.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/outer.xml
new file mode 100644
index 00000000000..55f188057e9
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/layout/outer.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Outer Layout"/>
+
+ <include layout="@layout/inner" />
+ <include layout="@layout/inner" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/menu/my.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/menu/my.xml
new file mode 100644
index 00000000000..f1fa1552e1f
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/menu/my.xml
@@ -0,0 +1,9 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:context=".MyActivity" >
+ <item android:id="@+id/action_settings"
+ android:title="@string/action_settings"
+ android:orderInCategory="100"
+ app:showAsAction="never" />
+</menu>
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/values-w820dp/dimens.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 00000000000..63fc8164446
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+ <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/values/dimens.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/values/dimens.xml
new file mode 100644
index 00000000000..47c82246738
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/values/dimens.xml
@@ -0,0 +1,5 @@
+<resources>
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/values/strings.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000000..8f02e32deff
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/values/strings.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="app_name">LayoutTest</string>
+ <string name="hello_world">Hello world!</string>
+ <string name="action_settings">Settings</string>
+ <string name="test">Test</string>
+
+</resources>
diff --git a/android/testData/guiTests/LayoutTest/app/src/main/res/values/styles.xml b/android/testData/guiTests/LayoutTest/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000000..766ab993048
--- /dev/null
+++ b/android/testData/guiTests/LayoutTest/app/src/main/res/values/styles.xml
@@ -0,0 +1,8 @@
+<resources>
+
+ <!-- Base application theme. -->
+ <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <!-- Customize your theme here. -->
+ </style>
+
+</resources>