From 294c9fb8990ded73be52a3c1bfddbe1cebcd8b8e Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 30 Jun 2010 14:18:32 -0400 Subject: [PATCH] Improved graphics for the intruder alert. Change-Id: I9aa6c8995da39f332b724fabe67ed5efe584552f --- core/res/res/anim/priority_alert_enter.xml | 14 +++++++++++ core/res/res/anim/priority_alert_exit.xml | 14 +++++++++++ core/res/res/values/styles.xml | 7 ++++++ .../drawable-hdpi/alert_bar_background.9.png | Bin 5925 -> 0 bytes .../alert_bar_background_normal.9.png | Bin 0 -> 1078 bytes .../alert_bar_background_pressed.9.png | Bin 0 -> 1093 bytes ....png => alert_bar_background_normal.9.png} | Bin .../alert_bar_background_pressed.9.png | Bin 0 -> 2896 bytes .../res/drawable/alert_bar_background.xml | 23 ++++++++++++++++++ .../SystemUI/res/layout/intruder_alert.xml | 18 +++++++++----- packages/SystemUI/res/values/styles.xml | 5 ++-- .../systemui/statusbar/StatusBarService.java | 9 ++++--- 12 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 core/res/res/anim/priority_alert_enter.xml create mode 100644 core/res/res/anim/priority_alert_exit.xml delete mode 100644 packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png create mode 100644 packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png create mode 100644 packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png rename packages/SystemUI/res/drawable-mdpi/{alert_bar_background.9.png => alert_bar_background_normal.9.png} (100%) create mode 100644 packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png create mode 100644 packages/SystemUI/res/drawable/alert_bar_background.xml diff --git a/core/res/res/anim/priority_alert_enter.xml b/core/res/res/anim/priority_alert_enter.xml new file mode 100644 index 0000000000000..c8ce23c6b66a5 --- /dev/null +++ b/core/res/res/anim/priority_alert_enter.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/core/res/res/anim/priority_alert_exit.xml b/core/res/res/anim/priority_alert_exit.xml new file mode 100644 index 0000000000000..b538cb28b5c94 --- /dev/null +++ b/core/res/res/anim/priority_alert_exit.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index af04117db6c71..02a601a491ba8 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -88,6 +88,13 @@ @anim/status_bar_exit + + + + + + + + + diff --git a/packages/SystemUI/res/layout/intruder_alert.xml b/packages/SystemUI/res/layout/intruder_alert.xml index 58dc333c5de8e..24eb960da7455 100644 --- a/packages/SystemUI/res/layout/intruder_alert.xml +++ b/packages/SystemUI/res/layout/intruder_alert.xml @@ -21,29 +21,35 @@ ?android:attr/textColorPrimary - - + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index 7eef0e9ee09b8..4029ad1516bf5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java @@ -357,7 +357,7 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, - height, + ViewGroup.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS @@ -366,9 +366,9 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, PixelFormat.TRANSLUCENT); lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; - lp.y += height * 1.5; // for now + lp.y += height * 1.5; // FIXME lp.setTitle("IntruderAlert"); - lp.windowAnimations = android.R.style.Animation_Dialog; + lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar_IntruderAlert; WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp); } @@ -417,7 +417,8 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks iconView.getStatusBarIcon())); alertText.setText(notification.notification.tickerText); - mIntruderAlertView.setOnClickListener( + View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content); + button.setOnClickListener( new Launcher(notification.notification.contentIntent, notification.pkg, notification.tag, notification.id));