summaryrefslogtreecommitdiffstats
path: root/tests/BiDiTests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-07-15 16:46:44 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-07-15 17:05:11 -0700
commit54d69625558f401d5fe65309effb713d2ea06f54 (patch)
tree13f7cf823edff8399fc87476cf7de908da8cbdc9 /tests/BiDiTests
parentc1df573aedd20e9ac862765d068cc4e8fcdda953 (diff)
downloadframeworks_base-54d69625558f401d5fe65309effb713d2ea06f54.zip
frameworks_base-54d69625558f401d5fe65309effb713d2ea06f54.tar.gz
frameworks_base-54d69625558f401d5fe65309effb713d2ea06f54.tar.bz2
Fix bug #4972141 Overlapping content in single-choice dialogs
- need to take care about padding resolution Change-Id: Ida9738ffada6c6455b7949f933fa61924c4f7961
Diffstat (limited to 'tests/BiDiTests')
-rw-r--r--tests/BiDiTests/res/layout/basic.xml6
-rw-r--r--tests/BiDiTests/res/values/strings.xml1
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestBasic.java29
3 files changed, 34 insertions, 2 deletions
diff --git a/tests/BiDiTests/res/layout/basic.xml b/tests/BiDiTests/res/layout/basic.xml
index d438b2c..348f8aa 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>
</FrameLayout> \ No newline at end of file
diff --git a/tests/BiDiTests/res/values/strings.xml b/tests/BiDiTests/res/values/strings.xml
index c0bbe94..74ee0d3 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();
}
}