diff options
Diffstat (limited to 'tests/BiDiTests')
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); + } +} |