diff options
| author | 2010-10-18 19:01:44 -0700 | |
|---|---|---|
| committer | 2010-10-18 19:01:44 -0700 | |
| commit | 8e5992ad66c601b5d528c4d0259bee881d7a35a8 (patch) | |
| tree | f929db5b7cc0b69bb03863af5e75f3bfc020ea60 | |
| parent | fb0c3aa596aba488d59d632281b5375d072abd49 (diff) | |
| parent | fc94ddef2f8f56beebd848a73f434673d56631cb (diff) | |
Merge "New dialog assets. Cancelable AlertDialogs may now be canceled by tapping outside."
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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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> |