Make View respect LAYOUT_DIRECTION_LOCALE

- update also unit tests for taking care of the locale direction
- code formatting on the layout test files

Change-Id: I4037eac3c572de9abb0178f36ca03803cc2c1522
This commit is contained in:
Fabrice Di Meglio
2011-06-10 14:19:18 -07:00
parent 6b6091a140
commit 26e432d25f
29 changed files with 1939 additions and 721 deletions

View File

@@ -76,6 +76,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import java.util.WeakHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -8665,7 +8666,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
/**
* Resolving the layout direction. LTR is set initially.
* We are supposing here that the parent directionality will be resolved before its children
* We are supposing here that the parent directionality will be resolved before its children.
*/
private void resolveLayoutDirection() {
mPrivateFlags2 &= ~RESOLVED_LAYOUT_RTL;
@@ -8680,6 +8681,34 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
case LAYOUT_DIRECTION_RTL:
mPrivateFlags2 |= RESOLVED_LAYOUT_RTL;
break;
case LAYOUT_DIRECTION_LOCALE:
if(isLayoutDirectionRtl(Locale.getDefault())) {
mPrivateFlags2 |= RESOLVED_LAYOUT_RTL;
}
break;
default:
// Nothing to do, LTR by default
}
}
/**
* Check if a Locale is corresponding to a RTL script.
*
* @param locale Locale to check
* @return true if a Locale is corresponding to a RTL script.
*/
private static boolean isLayoutDirectionRtl(Locale locale) {
if (locale == null || locale.equals(Locale.ROOT)) return false;
// Be careful: this code will need to be changed when vertical scripts will be supported
// OR if ICU4C is updated to have the "likelySubtags" file
switch(Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) {
case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
return false;
case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
return true;
default:
return false;
}
}

0
tests/BiDiTests/Android Normal file
View File

View File

@@ -57,6 +57,13 @@
</intent-filter>
</activity>
<activity android:name=".BiDiTestLinearLayoutLocaleActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".BiDiTestFrameLayoutLtrActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
@@ -71,6 +78,13 @@
</intent-filter>
</activity>
<activity android:name=".BiDiTestFrameLayoutLocaleActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".BiDiTestRelativeLayoutLtrActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
@@ -99,6 +113,13 @@
</intent-filter>
</activity>
<activity android:name=".BiDiTestRelativeLayoutLocaleActivity2"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".BiDiTestTableLayoutLtrActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
@@ -113,6 +134,13 @@
</intent-filter>
</activity>
<activity android:name=".BiDiTestTableLayoutLocaleActivity"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -15,34 +15,34 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_text"
android:textSize="32dip"
/>
<Button android:id="@+id/button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_text"
android:textSize="32dip"
/>
<TextView android:id="@+id/textview"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="32dip"
android:text="@string/textview_text"
/>
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="32dip"
android:text="@string/textview_text"
/>
<EditText android:id="@+id/edittext"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="32dip"
/>
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="32dip"
/>
</LinearLayout>

View File

@@ -15,20 +15,20 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<SeekBar android:id="@+id/seekbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
<view class="com.android.bidi.BiDiTestView"
android:id="@+id/testview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF0000"
/>
android:id="@+id/testview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF0000"
/>
</LinearLayout>

View File

@@ -0,0 +1,88 @@
<?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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="locale"
android:background="#FF000000">
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="right|center_vertical"
android:background="#FFFF0000">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="left|center_vertical"
android:background="#FF00FF00">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|center_horizontal"
android:background="#FF0000FF">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#FF00FFFF">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|start"
android:background="#FFFFFFFF">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|end"
android:background="#FFFFFF00">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|start"
android:background="#FFFFFFFF">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|end"
android:background="#FFFFFF00">
</FrameLayout>
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#FF888888">
</FrameLayout>
</FrameLayout>

View File

@@ -15,74 +15,74 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr"
android:background="#FF000000">
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr"
android:background="#FF000000">
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="right|center_vertical"
android:background="#FFFF0000">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="left|center_vertical"
android:background="#FF00FF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|center_horizontal"
android:background="#FF0000FF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#FF00FFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|start"
android:background="#FFFFFFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|end"
android:background="#FFFFFF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|start"
android:background="#FFFFFFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|end"
android:background="#FFFFFF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#FF888888">
</FrameLayout>
</FrameLayout>
</FrameLayout>

View File

@@ -15,74 +15,74 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl"
android:background="#FF000000">
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl"
android:background="#FF000000">
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="right|center_vertical"
android:background="#FFFF0000">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="left|center_vertical"
android:background="#FF00FF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|center_horizontal"
android:background="#FF0000FF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#FF00FFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|start"
android:background="#FFFFFFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|end"
android:background="#FFFFFF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|start"
android:background="#FFFFFFFF">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|end"
android:background="#FFFFFF00">
</FrameLayout>
</FrameLayout>
<FrameLayout
<FrameLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#FF888888">
</FrameLayout>
</FrameLayout>
</FrameLayout>

View File

@@ -0,0 +1,257 @@
<?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_rtl"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="locale">
<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:layoutDirection="inherit">
<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:layoutDirection="ltr">
<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:layoutDirection="rtl">
<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:layoutDirection="locale">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale">
<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>

View File

@@ -15,198 +15,243 @@
-->
<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:layoutDirection="ltr">
android:id="@+id/linear_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
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"
/>
<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:layoutDirection="inherit">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
<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/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:layoutDirection="ltr">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<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/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:layoutDirection="rtl">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale">
<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>

View File

@@ -15,198 +15,243 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear_layout_rtl"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">
android:id="@+id/linear_layout_rtl"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
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"
/>
<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:layoutDirection="inherit">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
<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/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:layoutDirection="ltr">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<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/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:layoutDirection="rtl">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="inherit">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<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/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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl">
<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="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale">
<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>

View File

@@ -15,26 +15,26 @@
-->
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp"/>
</LinearLayout>

View File

@@ -0,0 +1,183 @@
<?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/relative_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="locale">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px">
<TextView android:id="@+id/label_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_1"/>
<Button android:id="@+id/ok_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_1"
android:layout_alignTop="@id/ok_1"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="ltr">
<TextView android:id="@+id/label_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_2"/>
<Button android:id="@+id/ok_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_2"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_2"
android:layout_alignTop="@id/ok_2"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="inherit">
<TextView android:id="@+id/label_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_3"/>
<Button android:id="@+id/ok_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_3"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_3"
android:layout_alignTop="@id/ok_3"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="rtl">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="locale">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,183 @@
<?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/relative_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px">
<TextView android:id="@+id/label_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_1"/>
<Button android:id="@+id/ok_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_1"
android:layout_alignTop="@id/ok_1"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="ltr">
<TextView android:id="@+id/label_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_2"/>
<Button android:id="@+id/ok_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_2"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_2"
android:layout_alignTop="@id/ok_2"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="inherit">
<TextView android:id="@+id/label_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_3"/>
<Button android:id="@+id/ok_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_3"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_3"
android:layout_alignTop="@id/ok_3"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="rtl">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="locale">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,183 @@
<?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/relative_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px">
<TextView android:id="@+id/label_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_1"/>
<Button android:id="@+id/ok_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_1"
android:layout_alignTop="@id/ok_1"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="ltr">
<TextView android:id="@+id/label_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_2"/>
<Button android:id="@+id/ok_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_2"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_2"
android:layout_alignTop="@id/ok_2"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="inherit">
<TextView android:id="@+id/label_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_3"/>
<Button android:id="@+id/ok_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_3"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_3"
android:layout_alignTop="@id/ok_3"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="rtl">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="locale">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4"/>
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel"/>
</RelativeLayout>
</LinearLayout>

View File

@@ -15,74 +15,74 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr"
android:background="#FF000000">
android:id="@+id/frame_layout_ltr"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr"
android:background="#FF000000">
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="right|center_vertical"
android:background="#FFFF0000">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="left|center_vertical"
android:background="#FF00FF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|center_horizontal"
android:background="#FF0000FF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#FF00FFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|start"
android:background="#FFFFFFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|end"
android:background="#FFFFFF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|start"
android:background="#FFFFFFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|end"
android:background="#FFFFFF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#FF888888">
</RelativeLayout>
</RelativeLayout>
</FrameLayout>

View File

@@ -1,155 +0,0 @@
<?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/relative_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px">
<TextView android:id="@+id/label_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_1" />
<Button android:id="@+id/ok_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_1"
android:layout_alignTop="@id/ok_1"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="ltr">
<TextView android:id="@+id/label_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_2" />
<Button android:id="@+id/ok_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_2"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_2"
android:layout_alignTop="@id/ok_2"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="inherit">
<TextView android:id="@+id/label_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_3" />
<Button android:id="@+id/ok_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_3"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_3"
android:layout_alignTop="@id/ok_3"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="rtl">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4" />
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel" />
</RelativeLayout>
</LinearLayout>

View File

@@ -15,74 +15,74 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_rtl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl"
android:background="#FF000000">
android:id="@+id/frame_layout_rtl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl"
android:background="#FF000000">
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="right|center_vertical"
android:background="#FFFF0000">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="left|center_vertical"
android:background="#FF00FF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|center_horizontal"
android:background="#FF0000FF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#FF00FFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|start"
android:background="#FFFFFFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="top|end"
android:background="#FFFFFF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|start"
android:background="#FFFFFFFF">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom|end"
android:background="#FFFFFF00">
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#FF888888">
</RelativeLayout>
</RelativeLayout>
</FrameLayout>

View File

@@ -1,155 +0,0 @@
<?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/relative_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px">
<TextView android:id="@+id/label_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_1" />
<Button android:id="@+id/ok_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_1"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_1"
android:layout_alignTop="@id/ok_1"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="ltr">
<TextView android:id="@+id/label_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_2" />
<Button android:id="@+id/ok_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_2"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_2"
android:layout_alignTop="@id/ok_2"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="inherit">
<TextView android:id="@+id/label_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_3" />
<Button android:id="@+id/ok_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_3"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_3"
android:layout_alignTop="@id/ok_3"
android:text="Cancel" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
android:padding="10px"
android:layoutDirection="rtl">
<TextView android:id="@+id/label_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label_4" />
<Button android:id="@+id/ok_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry_4"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok_4"
android:layout_alignTop="@id/ok_4"
android:text="Cancel" />
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,258 @@
<?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:layoutDirection="locale">
<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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="locale">
<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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_text"
android:textSize="24dip"
android:gravity="before"
/>
</TableRow>
</TableLayout>
</LinearLayout>

View File

@@ -15,35 +15,35 @@
-->
<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:layoutDirection="ltr">
android:id="@+id/linear_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="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">
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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -51,47 +51,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="inherit">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -99,47 +98,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="ltr">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -147,47 +145,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="rtl">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -195,21 +192,67 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="locale">
<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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_text"
android:textSize="24dip"
android:gravity="before"
/>
</TableRow>
</TableLayout>
</LinearLayout>

View File

@@ -15,35 +15,35 @@
-->
<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:layoutDirection="rtl">
android:id="@+id/linear_layout_ltr"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="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">
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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -51,47 +51,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="inherit">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -99,47 +98,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="ltr">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -147,47 +145,46 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="rtl">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1,2"
android:layoutDirection="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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
/>
</TableRow>
<TableRow>
@@ -195,21 +192,67 @@
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_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:layoutDirection="locale">
<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/button_right_text"
android:textSize="24dip"
android:gravity="right"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_after_text"
android:textSize="24dip"
android:gravity="after"
/>
</TableRow>
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button2_text"
android:textSize="24dip"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_left_text"
android:textSize="24dip"
android:gravity="left"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_before_text"
android:textSize="24dip"
android:gravity="before"
/>
</TableRow>
</TableLayout>
</LinearLayout>

View File

@@ -57,6 +57,11 @@ public class BiDiTestActivity extends TabActivity {
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestLinearLayoutLocaleActivity.class);
spec = tabHost.newTabSpec("linear-layout-locale").setIndicator("Linear LOC").
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestFrameLayoutLtrActivity.class);
spec = tabHost.newTabSpec("frame-layout-ltr").setIndicator("Frame LTR").
setContent(intent);
@@ -67,6 +72,11 @@ public class BiDiTestActivity extends TabActivity {
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestFrameLayoutLocaleActivity.class);
spec = tabHost.newTabSpec("frame-layout-locale").setIndicator("Frame LOC").
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestRelativeLayoutLtrActivity.class);
spec = tabHost.newTabSpec("relative-layout-ltr").setIndicator("Relative LTR").
setContent(intent);
@@ -87,6 +97,11 @@ public class BiDiTestActivity extends TabActivity {
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestRelativeLayoutLocaleActivity2.class);
spec = tabHost.newTabSpec("relative-layout-locale-2").setIndicator("Relative2 LOC").
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestTableLayoutLtrActivity.class);
spec = tabHost.newTabSpec("table-layout-ltr").setIndicator("Table LTR").
setContent(intent);
@@ -97,6 +112,11 @@ public class BiDiTestActivity extends TabActivity {
setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, BiDiTestTableLayoutLocaleActivity.class);
spec = tabHost.newTabSpec("table-layout-locale").setIndicator("Table LOC").
setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
}
}

View File

@@ -0,0 +1,31 @@
/*
* 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.
*/
package com.android.bidi;
import android.app.Activity;
import android.os.Bundle;
public class BiDiTestFrameLayoutLocaleActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.frame_layout_locale);
}
}

View File

@@ -0,0 +1,30 @@
/*
* 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.
*/
package com.android.bidi;
import android.app.Activity;
import android.os.Bundle;
public class BiDiTestLinearLayoutLocaleActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.linear_layout_locale);
}
}

View File

@@ -0,0 +1,31 @@
/*
* 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.
*/
package com.android.bidi;
import android.app.Activity;
import android.os.Bundle;
public class BiDiTestRelativeLayoutLocaleActivity2 extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.relative_layout_2_locale);
}
}

View File

@@ -25,7 +25,7 @@ public class BiDiTestRelativeLayoutLtrActivity2 extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.relative_layout_ltr_2);
setContentView(R.layout.relative_layout_2_ltr);
}
}

View File

@@ -25,7 +25,7 @@ public class BiDiTestRelativeLayoutRtlActivity2 extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.relative_layout_rtl_2);
setContentView(R.layout.relative_layout_2_rtl);
}
}

View File

@@ -0,0 +1,31 @@
/*
* 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.
*/
package com.android.bidi;
import android.app.Activity;
import android.os.Bundle;
public class BiDiTestTableLayoutLocaleActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.table_layout_locale);
}
}