diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-06-02 10:55:58 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-06-02 10:55:58 -0700 |
commit | 88f9fd2316d764e792a84c43aef67816ac02ef14 (patch) | |
tree | 5cea301b219188e8e667629fdd0d85d7476bcb64 /tests/BiDiTests/res/layout | |
parent | 52ae3f345bff3cc4209faa441c25be0b713ff6b4 (diff) | |
download | frameworks_base-88f9fd2316d764e792a84c43aef67816ac02ef14.zip frameworks_base-88f9fd2316d764e792a84c43aef67816ac02ef14.tar.gz frameworks_base-88f9fd2316d764e792a84c43aef67816ac02ef14.tar.bz2 |
Add more unit tests for RTL layouts
- update LinearLayout tests with default case (no horizontalDirection specified)
- add TableLayout tests
Change-Id: I9ad2239fca96b896c5aae4dfe67b8113faf2f96e
Diffstat (limited to 'tests/BiDiTests/res/layout')
-rw-r--r-- | tests/BiDiTests/res/layout/linear_layout_ltr.xml | 62 | ||||
-rw-r--r-- | tests/BiDiTests/res/layout/linear_layout_rtl.xml | 62 | ||||
-rw-r--r-- | tests/BiDiTests/res/layout/table_layout_ltr.xml | 215 | ||||
-rw-r--r-- | tests/BiDiTests/res/layout/table_layout_rtl.xml | 215 |
4 files changed, 518 insertions, 36 deletions
diff --git a/tests/BiDiTests/res/layout/linear_layout_ltr.xml b/tests/BiDiTests/res/layout/linear_layout_ltr.xml index 1370ae1..c5a8d47 100644 --- a/tests/BiDiTests/res/layout/linear_layout_ltr.xml +++ b/tests/BiDiTests/res/layout/linear_layout_ltr.xml @@ -24,26 +24,52 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + + <TextView android:id="@+id/textview" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:textSize="24dip" + android:text="@string/textview_text" + /> + + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + /> + + </LinearLayout> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" android:layout_height="wrap_content" android:horizontalDirection="inherit"> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -57,20 +83,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -84,20 +110,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -111,20 +137,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -138,20 +164,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -165,20 +191,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> diff --git a/tests/BiDiTests/res/layout/linear_layout_rtl.xml b/tests/BiDiTests/res/layout/linear_layout_rtl.xml index 6044f16..1494fec 100644 --- a/tests/BiDiTests/res/layout/linear_layout_rtl.xml +++ b/tests/BiDiTests/res/layout/linear_layout_rtl.xml @@ -24,26 +24,52 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + + <TextView android:id="@+id/textview" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:textSize="24dip" + android:text="@string/textview_text" + /> + + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + /> + + </LinearLayout> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" android:layout_height="wrap_content" android:horizontalDirection="inherit"> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -57,20 +83,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -84,20 +110,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -111,20 +137,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -138,20 +164,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> @@ -165,20 +191,20 @@ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button1_text" - android:textSize="32dip" + android:textSize="24dip" /> <TextView android:id="@+id/textview" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="32dip" + android:textSize="24dip" android:text="@string/textview_text" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/button2_text" - android:textSize="32dip" + android:textSize="24dip" /> </LinearLayout> diff --git a/tests/BiDiTests/res/layout/table_layout_ltr.xml b/tests/BiDiTests/res/layout/table_layout_ltr.xml new file mode 100644 index 0000000..62b1819 --- /dev/null +++ b/tests/BiDiTests/res/layout/table_layout_ltr.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/linear_layout_ltr" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:horizontalDirection="ltr"> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="inherit"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="ltr"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="rtl"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + +</LinearLayout>
\ No newline at end of file diff --git a/tests/BiDiTests/res/layout/table_layout_rtl.xml b/tests/BiDiTests/res/layout/table_layout_rtl.xml new file mode 100644 index 0000000..74e6286 --- /dev/null +++ b/tests/BiDiTests/res/layout/table_layout_rtl.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/linear_layout_ltr" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:horizontalDirection="rtl"> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="inherit"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="ltr"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + + <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:stretchColumns="1,2" + android:horizontalDirection="rtl"> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button1_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button2_text" + android:textSize="24dip" + android:gravity="right" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button3_text" + android:textSize="24dip" + android:gravity="after" + /> + </TableRow> + + <TableRow> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button4_text" + android:textSize="24dip" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button5_text" + android:textSize="24dip" + android:gravity="left" + /> + <Button android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button6_text" + android:textSize="24dip" + android:gravity="before" + /> + </TableRow> + + </TableLayout> + +</LinearLayout>
\ No newline at end of file |