summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2010-10-18 19:01:44 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-10-18 19:01:44 -0700
commit8e5992ad66c601b5d528c4d0259bee881d7a35a8 (patch)
treef929db5b7cc0b69bb03863af5e75f3bfc020ea60
parentfb0c3aa596aba488d59d632281b5375d072abd49 (diff)
parentfc94ddef2f8f56beebd848a73f434673d56631cb (diff)
Merge "New dialog assets. Cancelable AlertDialogs may now be canceled by tapping outside."
-rw-r--r--core/java/android/app/AlertDialog.java19
-rw-r--r--core/java/android/widget/ButtonGroup.java2
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.pngbin3283 -> 4951 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.pngbin3244 -> 5220 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_dark.9.pngbin2842 -> 8974 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_light.9.pngbin2835 -> 19481 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_dark.pngbin676 -> 676 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_light.pngbin675 -> 675 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_dark.pngbin337 -> 337 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_light.pngbin347 -> 347 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_dark.pngbin444 -> 444 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_light.pngbin496 -> 496 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.pngbin592 -> 1715 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_light.9.pngbin601 -> 1339 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_dark.9.pngbin6121 -> 13835 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_light.9.pngbin6029 -> 13413 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.pngbin1572 -> 2932 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.pngbin1580 -> 3072 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_dark.9.pngbin1423 -> 5215 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_light.9.pngbin1419 -> 12512 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_dark.pngbin492 -> 492 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_light.pngbin481 -> 481 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_dark.pngbin310 -> 310 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_light.pngbin313 -> 313 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_dark.pngbin356 -> 356 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_light.pngbin393 -> 393 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.pngbin291 -> 1119 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_light.9.pngbin284 -> 932 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_dark.9.pngbin2976 -> 9009 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_light.9.pngbin2924 -> 8747 bytes
-rw-r--r--core/res/res/values/themes.xml2
31 files changed, 21 insertions, 2 deletions
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 4a629bbecf20..ac3ca55922f6 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -28,6 +28,7 @@ import android.util.Log;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
+import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
@@ -81,6 +82,24 @@ public class AlertDialog extends Dialog implements DialogInterface {
return outValue.resourceId;
}
+ @Override
+ public boolean onTouchEvent(MotionEvent ev) {
+ if (mCancelable) {
+ final View decor = mWindow.getDecorView();
+ final int width = decor.getWidth();
+ final int height = decor.getHeight();
+ final float x = ev.getX();
+ final float y = ev.getY();
+
+ if (mCancelable && (x < 0 || x > width || y < 0 || y > height)) {
+ cancel();
+ return true;
+ }
+ }
+
+ return super.onTouchEvent(ev);
+ }
+
/**
* Gets one of the buttons used in the dialog.
* <p>
diff --git a/core/java/android/widget/ButtonGroup.java b/core/java/android/widget/ButtonGroup.java
index a9463ffb4620..ce3decbb2e68 100644
--- a/core/java/android/widget/ButtonGroup.java
+++ b/core/java/android/widget/ButtonGroup.java
@@ -125,7 +125,7 @@ public class ButtonGroup extends LinearLayout {
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
- if (mButtonBackgroundRes != 0) {
+ if (child instanceof Button && mButtonBackgroundRes != 0) {
// Preserve original padding as we change the background
final int paddingLeft = child.getPaddingLeft();
final int paddingRight = child.getPaddingRight();
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
index 83c0852a4e71..bbfb9f73e2d5 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
index c4952164b352..af69ee5e6e4b 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
index 620adaa4ec8e..59b9b1376954 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
index b03d6cdc7ec6..e1ec9dc4deda 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_dark.png b/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_dark.png
index 785ae6eb4e14..0b67f246ef13 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_dark.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_light.png b/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_light.png
index d96787b054eb..107ffe418ebf 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_light.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_dark.png b/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_dark.png
index d042a8177473..27112844bad4 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_dark.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_light.png b/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_light.png
index 677cf3dd26d8..1aca4b793fc8 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_light.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_dark.png b/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_dark.png
index 9b13c5b32a83..9e06c00bc926 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_dark.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_light.png b/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_light.png
index 8e245fc13de3..f03251008c11 100644
--- a/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_light.png
+++ b/core/res/res/drawable-hdpi/dialog_ic_close_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
index cffae3e152b4..a9f85eadd43b 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
index 0394885fb51f..c4c46525514b 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
index 6746ce8e9998..32c2cb440461 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
index bdcdc718d83b..7a8fb0e700bd 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
index e3a30a99755e..1e2d3270874a 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
index f7f344af54ca..ac2d7a3727c2 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
index 26bf28a73049..9d934034a6b6 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
index 0edfe85e7fd1..1c08e6a06c89 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_dark.png b/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_dark.png
index 4f08fb4a62ed..cc5f4f47b240 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_dark.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_light.png b/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_light.png
index cc535bd41e74..51b4e4d81f0d 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_light.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_dark.png b/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_dark.png
index 9d3e5b95299e..503db7cfa29e 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_dark.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_light.png b/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_light.png
index 74aff557a94d..6a2fb5e636f5 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_light.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_dark.png b/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_dark.png
index c7f7699719c2..3463b6689134 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_dark.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_light.png b/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_light.png
index a10f9a686407..55dedc62db61 100644
--- a/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_light.png
+++ b/core/res/res/drawable-mdpi/dialog_ic_close_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
index 51e7ec3cb333..741b8dcbfad4 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
index c4b70625af3c..0854fe5c2e2f 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
index 7f97eaee075d..43c0050f6d71 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
index 341bb4ba0ca1..bc5fc92bdd26 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 06c502b8f404..d7954a769b00 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -89,7 +89,7 @@
<item name="buttonStyleToggle">@android:style/Widget.Button.Toggle</item>
- <item name="groupButtonBackground">@android:drawable/btn_default</item>
+ <item name="groupButtonBackground">@null</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>