diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-07-15 17:51:46 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-15 17:51:46 -0700 |
commit | 9c83011005349f2f0ebefb47c8ea7fc4bb5a07f7 (patch) | |
tree | b5a33b89deba6b602e0820b410c0bc1f9f7de886 /tests | |
parent | 170626b2bafe4b708aab043313867a66d5e6b972 (diff) | |
parent | 54d69625558f401d5fe65309effb713d2ea06f54 (diff) | |
download | frameworks_base-9c83011005349f2f0ebefb47c8ea7fc4bb5a07f7.zip frameworks_base-9c83011005349f2f0ebefb47c8ea7fc4bb5a07f7.tar.gz frameworks_base-9c83011005349f2f0ebefb47c8ea7fc4bb5a07f7.tar.bz2 |
Merge "Fix bug #4972141 Overlapping content in single-choice dialogs"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/BiDiTests/res/layout/basic.xml | 8 | ||||
-rw-r--r-- | tests/BiDiTests/res/values/strings.xml | 1 | ||||
-rw-r--r-- | tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java | 29 |
3 files changed, 35 insertions, 3 deletions
diff --git a/tests/BiDiTests/res/layout/basic.xml b/tests/BiDiTests/res/layout/basic.xml index c1ebd20..ed91c49 100644 --- a/tests/BiDiTests/res/layout/basic.xml +++ b/tests/BiDiTests/res/layout/basic.xml @@ -49,6 +49,12 @@ </LinearLayout> + <Button android:id="@+id/button_alert_dialog" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/button_alert_dialog_text" + android:textSize="32dip" + /> </LinearLayout> <LinearLayout @@ -79,4 +85,4 @@ </LinearLayout> </LinearLayout> -</FrameLayout>
\ No newline at end of file +</FrameLayout> diff --git a/tests/BiDiTests/res/values/strings.xml b/tests/BiDiTests/res/values/strings.xml index 9a486c1..bc99e79 100644 --- a/tests/BiDiTests/res/values/strings.xml +++ b/tests/BiDiTests/res/values/strings.xml @@ -23,6 +23,7 @@ <string name="button_left_text">Left</string> <string name="button_before_text">Start</string> <string name="button_requestlayout_text">Request Layout</string> + <string name="button_alert_dialog_text">AlertDialog</string> <string name="textview_text">This is a text for a TextView</string> <string name="edittext_text">mmmmmmmmmmmmmmmmmmmmmmmm</string> <string name="normal_text">Normal String</string> diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java index 9b3918d..f0b7438 100644 --- a/tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java +++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java @@ -16,17 +16,42 @@ package com.android.bidi; +import android.app.AlertDialog; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; public class BiDiTestBasic extends Fragment { - + + private View currentView; + private Button alertDialogButton; + private String[] items = {"This is a very very very very very very very very very very very long Item1", "Item2"}; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.basic, container, false); + currentView = inflater.inflate(R.layout.basic, container, false); + return currentView; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + alertDialogButton = (Button) currentView.findViewById(R.id.button_alert_dialog); + alertDialogButton.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + showDialog(); + } + }); + } + + private void showDialog() { + AlertDialog.Builder builder = new AlertDialog.Builder(currentView.getContext()); + builder.setSingleChoiceItems(items, 0, null); + builder.show(); } } |