summaryrefslogtreecommitdiffstats
path: root/tests/BiDiTests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-07-15 09:49:48 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-15 09:49:48 -0700
commit50e95eba5c7cf70a0ecbc50c0cf5b700201aa67f (patch)
tree30bd9123b3c61be3f6fb163572e16fa24716c399 /tests/BiDiTests
parent38143a682274dd5f9212d9092ed3553f2ec3e88c (diff)
parentcb379120456d8065d742021fc5c66748fc8a11a8 (diff)
downloadframeworks_base-50e95eba5c7cf70a0ecbc50c0cf5b700201aa67f.zip
frameworks_base-50e95eba5c7cf70a0ecbc50c0cf5b700201aa67f.tar.gz
frameworks_base-50e95eba5c7cf70a0ecbc50c0cf5b700201aa67f.tar.bz2
Merge "Implement textDirection heuristic selection."
Diffstat (limited to 'tests/BiDiTests')
-rw-r--r--tests/BiDiTests/res/layout/textview_direction_ltr.xml305
-rw-r--r--tests/BiDiTests/res/layout/textview_direction_rtl.xml305
-rw-r--r--tests/BiDiTests/res/values/strings.xml2
3 files changed, 443 insertions, 169 deletions
diff --git a/tests/BiDiTests/res/layout/textview_direction_ltr.xml b/tests/BiDiTests/res/layout/textview_direction_ltr.xml
index f7b7b8e..2c790ec 100644
--- a/tests/BiDiTests/res/layout/textview_direction_ltr.xml
+++ b/tests/BiDiTests/res/layout/textview_direction_ltr.xml
@@ -18,95 +18,232 @@
android:id="@+id/textview_direction_ltr"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:layoutDirection="ltr">
+ android:layoutDirection="ltr"
+ android:textDirection="ltr">
- <LinearLayout android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textDirection="ltr">
-
- <LinearLayout android:orientation="vertical"
+ <TableLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="inherit"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="firstStrong"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="anyRtl"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="ltr"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="rtl"
- />
- </LinearLayout>
+ <TableRow>
+ <TextView android:text="(unspecified)"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- <LinearLayout android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
+ <TableRow>
+ <TextView android:text="inherit"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="inherit"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="firstStrong"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="anyRtl"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="ltr"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="rtl"
- />
- </LinearLayout>
+ <TableRow>
+ <TextView android:text="firstStrong"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="anyRtl"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="ltr"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="rtl"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginRight="7dip"
+ android:layout_marginLeft="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- </LinearLayout>
+ </TableLayout>
-</FrameLayout> \ No newline at end of file
+</FrameLayout>
diff --git a/tests/BiDiTests/res/layout/textview_direction_rtl.xml b/tests/BiDiTests/res/layout/textview_direction_rtl.xml
index 81c5411..1df100d 100644
--- a/tests/BiDiTests/res/layout/textview_direction_rtl.xml
+++ b/tests/BiDiTests/res/layout/textview_direction_rtl.xml
@@ -18,95 +18,232 @@
android:id="@+id/textview_direction_rtl"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:layoutDirection="rtl">
+ android:layoutDirection="rtl"
+ android:textDirection="rtl">
- <LinearLayout android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textDirection="rtl">
-
- <LinearLayout android:orientation="vertical"
+ <TableLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="inherit"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="firstStrong"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="anyRtl"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="ltr"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_text"
- android:textDirection="rtl"
- />
- </LinearLayout>
+ <TableRow>
+ <TextView android:text="(unspecified)"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- <LinearLayout android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
+ <TableRow>
+ <TextView android:text="inherit"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="inherit"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="inherit"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="firstStrong"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="anyRtl"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="ltr"
- />
- <TextView android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textSize="24dip"
- android:text="@string/textview_hebrew_text"
- android:textDirection="rtl"
- />
- </LinearLayout>
+ <TableRow>
+ <TextView android:text="firstStrong"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="firstStrong"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="anyRtl"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="anyRtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="ltr"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="ltr"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
+
+ <TableRow>
+ <TextView android:text="rtl"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:typeface="serif"
+ android:layout_marginRight="7dip"
+ android:layout_marginLeft="7dip"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_hebrew_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_latin_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ <TextView android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textSize="24dip"
+ android:text="@string/textview_multiline_text"
+ android:textDirection="rtl"
+ android:layout_marginLeft="7dip"
+ android:layout_marginRight="7dip"
+ android:background="#444444"
+ />
+ </TableRow>
- </LinearLayout>
+ </TableLayout>
-</FrameLayout> \ No newline at end of file
+</FrameLayout>
diff --git a/tests/BiDiTests/res/values/strings.xml b/tests/BiDiTests/res/values/strings.xml
index c0bbe94..9a486c1 100644
--- a/tests/BiDiTests/res/values/strings.xml
+++ b/tests/BiDiTests/res/values/strings.xml
@@ -40,6 +40,6 @@
<string name="menu_delete">Delete</string>
<string name="textview_hebrew_text">&#x05DD;&#x05DE;ab?!</string>
<string name="textview_latin_text">ab&#x05DD;&#x05DE;?!</string>
- <string name="textview_multiline_text">&#x05DD;&#x05DE;?!\nab?!</string>
+ <string name="textview_multiline_text">&#x05DD;&#x05DE;?!\nab?!\n?!</string>
</resources>