From 45dc35b3c9e7e1494c09f4ed167426da6d376a7d Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Wed, 2 Apr 2014 19:15:04 -0700 Subject: Fix dialog style, selectable item bg pinning, and pressed state BUG: 13746931 Change-Id: I31c2959f3e773a3aeb66ba5842d8d6fbb288acc1 --- core/java/android/view/View.java | 7 ++- core/res/res/drawable/item_background_quantum.xml | 3 +- core/res/res/layout/alert_dialog_quantum.xml | 55 +++++++----------- .../res/res/layout/dialog_custom_title_quantum.xml | 44 +++++++++++++++ core/res/res/layout/dialog_title_icons_quantum.xml | 65 ++++++++++++++++++++++ core/res/res/layout/dialog_title_quantum.xml | 46 +++++++++++++++ core/res/res/values/styles_quantum.xml | 16 +----- core/res/res/values/themes_quantum.xml | 12 ++-- .../java/android/graphics/drawable/Drawable.java | 14 ----- 9 files changed, 192 insertions(+), 70 deletions(-) create mode 100644 core/res/res/layout/dialog_custom_title_quantum.xml create mode 100644 core/res/res/layout/dialog_title_icons_quantum.xml create mode 100644 core/res/res/layout/dialog_title_quantum.xml diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 5be469822375..badd2c836fc6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4847,10 +4847,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, final float x = r.exactCenterX(); final float y = r.exactCenterY(); - mBackground.setHotspot(Drawable.HOTSPOT_FOCUS, x, y); + mBackground.setHotspot(R.attr.state_focused, x, y); if (!focused) { - mBackground.removeHotspot(Drawable.HOTSPOT_FOCUS); + mBackground.removeHotspot(R.attr.state_focused); } } } @@ -9092,6 +9092,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } removeTapCallback(); + } else { + clearHotspot(R.attr.state_pressed); } break; @@ -9204,6 +9206,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void removeUnsetPressCallback() { if ((mPrivateFlags & PFLAG_PRESSED) != 0 && mUnsetPressedState != null) { + clearHotspot(R.attr.state_pressed); setPressed(false); removeCallbacks(mUnsetPressedState); } diff --git a/core/res/res/drawable/item_background_quantum.xml b/core/res/res/drawable/item_background_quantum.xml index f668ca037f2c..11e1f67e79c0 100644 --- a/core/res/res/drawable/item_background_quantum.xml +++ b/core/res/res/drawable/item_background_quantum.xml @@ -15,4 +15,5 @@ --> + android:tint="?attr/colorButtonPressed" + android:pinned="true" /> diff --git a/core/res/res/layout/alert_dialog_quantum.xml b/core/res/res/layout/alert_dialog_quantum.xml index 4cc76ca6dc37..59dba08eddac 100644 --- a/core/res/res/layout/alert_dialog_quantum.xml +++ b/core/res/res/layout/alert_dialog_quantum.xml @@ -20,33 +20,26 @@ android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="8dip" - android:layout_marginEnd="8dip" android:orientation="vertical"> - + android:paddingStart="16dip" + android:paddingEnd="16dip" + android:paddingTop="16dip"> - - @@ -78,8 +66,7 @@ android:layout_height="wrap_content" android:paddingStart="16dip" android:paddingEnd="16dip" - android:paddingTop="8dip" - android:paddingBottom="8dip"/> + android:paddingTop="16dip" /> @@ -98,7 +85,7 @@ android:layout_height="wrap_content" android:minHeight="@dimen/alert_dialog_button_bar_height" android:orientation="vertical" - android:dividerPadding="0dip"> + android:padding="16dip"> -