diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png | bin | 5925 -> 0 bytes | |||
-rw-r--r-- | packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png | bin | 0 -> 1078 bytes | |||
-rw-r--r-- | packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png | bin | 0 -> 1093 bytes | |||
-rw-r--r-- | packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png (renamed from packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png) | bin | 2896 -> 2896 bytes | |||
-rw-r--r-- | packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png | bin | 0 -> 2896 bytes | |||
-rw-r--r-- | packages/SystemUI/res/drawable/alert_bar_background.xml | 23 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/intruder_alert.xml | 18 | ||||
-rw-r--r-- | packages/SystemUI/res/values/styles.xml | 5 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java | 9 |
9 files changed, 43 insertions, 12 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png Binary files differdeleted file mode 100644 index 7000eee..0000000 --- a/packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png Binary files differnew file mode 100644 index 0000000..bc127bd --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png Binary files differnew file mode 100644 index 0000000..59af804 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png Binary files differindex 258de13..258de13 100644 --- a/packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png +++ b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png Binary files differnew file mode 100644 index 0000000..258de13 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png diff --git a/packages/SystemUI/res/drawable/alert_bar_background.xml b/packages/SystemUI/res/drawable/alert_bar_background.xml new file mode 100644 index 0000000..24b6aa3 --- /dev/null +++ b/packages/SystemUI/res/drawable/alert_bar_background.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2008 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/alert_bar_background_pressed" /> + <item + android:drawable="@drawable/alert_bar_background_normal" /> +</selector> + diff --git a/packages/SystemUI/res/layout/intruder_alert.xml b/packages/SystemUI/res/layout/intruder_alert.xml index 58dc333..24eb960 100644 --- a/packages/SystemUI/res/layout/intruder_alert.xml +++ b/packages/SystemUI/res/layout/intruder_alert.xml @@ -21,29 +21,35 @@ <!-- android:background="@drawable/status_bar_closed_default_background" --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:background="@drawable/alert_bar_background" - android:orientation="horizontal" - android:focusable="true" - android:descendantFocusability="afterDescendants" + android:layout_height="32dip" + android:layout_width="match_parent" + android:paddingLeft="8dip" + android:paddingRight="8dip" > <LinearLayout + android:id="@+id/intruder_alert_content" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingLeft="6dip" + android:gravity="center" android:animationCache="false" android:orientation="horizontal" + android:background="@drawable/alert_bar_background" + android:clickable="true" + android:focusable="true" + android:descendantFocusability="afterDescendants" > <ImageView android:id="@+id/alertIcon" android:layout_width="25dip" android:layout_height="25dip" + android:paddingLeft="6dip" android:layout_marginRight="8dip" /> <TextView android:id="@+id/alertText" - android:textAppearance="@*android:style/TextAppearance.StatusBar.EventContent" + android:textAppearance="@style/TextAppearance.StatusBar.IntruderAlert" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 10fa930..816f34a4 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -22,6 +22,7 @@ <item name="android:textColor">?android:attr/textColorPrimary</item> </style> - - + <style name="TextAppearance.StatusBar.IntruderAlert" + parent="@android:style/TextAppearance.StatusBar"> + </style> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index 7eef0e9..4029ad1 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)); |