summaryrefslogtreecommitdiffstats
path: root/tests/BiDiTests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-06-20 17:41:21 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-06-24 18:55:24 -0700
commitb76023afd192a1f5c81a8965cfd1b9dde2558726 (patch)
treed6ba128d048fd999ee684c63fac424fc6b93412a /tests/BiDiTests
parent4c60c541de2399d92610b8a7f7f105a42c1ed2a9 (diff)
downloadframeworks_base-b76023afd192a1f5c81a8965cfd1b9dde2558726.zip
frameworks_base-b76023afd192a1f5c81a8965cfd1b9dde2558726.tar.gz
frameworks_base-b76023afd192a1f5c81a8965cfd1b9dde2558726.tar.bz2
Introduce MarginLayoutParams marginStart and margingEnd
- update BiDiTest app for adding more unit tests concerning margin Change-Id: Ia6a7e0a1948a2c375e8f3cc87d120a85351a8c27
Diffstat (limited to 'tests/BiDiTests')
-rw-r--r--tests/BiDiTests/res/layout/view_group_margin_mixed.xml241
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java19
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestViewGroupMarginMixed.java17
3 files changed, 270 insertions, 7 deletions
diff --git a/tests/BiDiTests/res/layout/view_group_margin_mixed.xml b/tests/BiDiTests/res/layout/view_group_margin_mixed.xml
new file mode 100644
index 0000000..5845b38
--- /dev/null
+++ b/tests/BiDiTests/res/layout/view_group_margin_mixed.xml
@@ -0,0 +1,241 @@
+<?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/view_group_margin_mixed"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#FFFFFFFF">
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layoutDirection="ltr">
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF0000FF">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="0dip"
+ android:layout_marginTop="0dip"
+ android:layout_marginBottom="0dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF000000">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="10dip"
+ android:layout_marginStart="5dip"
+ android:layout_marginRight="20dip"
+ android:layout_marginEnd="5dip"
+ android:layout_marginTop="5dip"
+ android:layout_marginBottom="5dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ </LinearLayout>
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layoutDirection="rtl">
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF0000FF">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="0dip"
+ android:layout_marginTop="0dip"
+ android:layout_marginBottom="0dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF000000">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="10dip"
+ android:layout_marginStart="5dip"
+ android:layout_marginRight="20dip"
+ android:layout_marginEnd="5dip"
+ android:layout_marginTop="5dip"
+ android:layout_marginBottom="5dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ </LinearLayout>
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layoutDirection="inherit">
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF0000FF">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="0dip"
+ android:layout_marginTop="0dip"
+ android:layout_marginBottom="0dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF000000">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="10dip"
+ android:layout_marginStart="5dip"
+ android:layout_marginRight="20dip"
+ android:layout_marginEnd="5dip"
+ android:layout_marginTop="5dip"
+ android:layout_marginBottom="5dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ </LinearLayout>
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layoutDirection="locale">
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF0000FF">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="0dip"
+ android:layout_marginTop="0dip"
+ android:layout_marginBottom="0dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF000000">
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:layout_marginLeft="10dip"
+ android:layout_marginStart="5dip"
+ android:layout_marginRight="20dip"
+ android:layout_marginEnd="5dip"
+ android:layout_marginTop="5dip"
+ android:layout_marginBottom="5dip"
+ android:background="#FFFF0000">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="80dp"
+ android:layout_height="80dp"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </LinearLayout>
+
+ </LinearLayout>
+
+ </LinearLayout>
+
+</FrameLayout> \ No newline at end of file
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
index c2683c2..b1e494a 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
@@ -106,29 +106,34 @@ public class BiDiTestActivity extends Activity {
addItem(result, "Linear LTR", BiDiTestLinearLayoutLtr.class, R.id.linear_layout_ltr);
addItem(result, "Linear RTL", BiDiTestLinearLayoutRtl.class, R.id.linear_layout_rtl);
addItem(result, "Linear LOC", BiDiTestLinearLayoutLocale.class, R.id.linear_layout_locale);
-
+
addItem(result, "Frame LTR", BiDiTestFrameLayoutLtr.class, R.id.frame_layout_ltr);
addItem(result, "Frame RTL", BiDiTestFrameLayoutRtl.class, R.id.frame_layout_rtl);
addItem(result, "Frame LOC", BiDiTestFrameLayoutLocale.class, R.id.frame_layout_locale);
-
+
addItem(result, "Relative LTR", BiDiTestRelativeLayoutLtr.class, R.id.relative_layout_ltr);
addItem(result, "Relative RTL", BiDiTestRelativeLayoutRtl.class, R.id.relative_layout_rtl);
-
+
addItem(result, "Relative2 LTR", BiDiTestRelativeLayout2Ltr.class, R.id.relative_layout_2_ltr);
addItem(result, "Relative2 RTL", BiDiTestRelativeLayout2Rtl.class, R.id.relative_layout_2_rtl);
addItem(result, "Relative2 LOC", BiDiTestRelativeLayout2Locale.class, R.id.relative_layout_2_locale);
-
+
addItem(result, "Table LTR", BiDiTestTableLayoutLtr.class, R.id.table_layout_ltr);
addItem(result, "Table RTL", BiDiTestTableLayoutRtl.class, R.id.table_layout_rtl);
addItem(result, "Table LOC", BiDiTestTableLayoutLocale.class, R.id.table_layout_locale);
+ addItem(result, "ViewPadding", BiDiTestViewPadding.class, R.id.view_padding);
+ addItem(result, "ViewPadding MIXED", BiDiTestViewPaddingMixed.class, R.id.view_padding_mixed);
+
+ addItem(result, "Padding", BiDiTestViewPadding.class, R.id.view_padding);
+ addItem(result, "Padding MIXED", BiDiTestViewPaddingMixed.class, R.id.view_padding_mixed);
+
+ addItem(result, "Margin MIXED", BiDiTestViewGroupMarginMixed.class, R.id.view_group_margin_mixed);
+
addItem(result, "TextView LTR", BiDiTestTextViewLtr.class, R.id.textview_ltr);
addItem(result, "TextView RTL", BiDiTestTextViewRtl.class, R.id.textview_rtl);
addItem(result, "TextView LOC", BiDiTestTextViewLocale.class, R.id.textview_locale);
- addItem(result, "ViewPadding", BiDiTestViewPadding.class, R.id.view_padding);
- addItem(result, "ViewPadding MIXED", BiDiTestViewPaddingMixed.class, R.id.view_padding_mixed);
-
return result;
}
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestViewGroupMarginMixed.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestViewGroupMarginMixed.java
new file mode 100644
index 0000000..ce8c380
--- /dev/null
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestViewGroupMarginMixed.java
@@ -0,0 +1,17 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+package com.android.bidi;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class BiDiTestViewGroupMarginMixed extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.view_group_margin_mixed, container, false);
+ }
+}