summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.pngbin699 -> 1139 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.pngbin1192 -> 1139 bytes
-rw-r--r--packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java72
5 files changed, 65 insertions, 15 deletions
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png
index f9a7cc2..3b7c9c7 100644
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png
+++ b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png
index 4461ac8..3b7c9c7 100644
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png
+++ b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml b/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
index fa492d0..049a1cc 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
@@ -8,12 +8,14 @@
<ImageButton
android:id="@+id/veto"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/status_bar_veto"
+ android:scaleType="center"
android:background="@null"
- android:padding="2dip"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
/>
<com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 45abe93..7e8a5c1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -117,7 +117,7 @@ public class NotificationData {
public boolean hasClearableItems() {
for (Entry e : mEntries) {
if (e.expanded != null) { // the view successfully inflated
- if ((e.notification.notification.flags & Notification.FLAG_NO_CLEAR) == 0) {
+ if (e.notification.isClearable()) {
return true;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
index ffa1690..0e26f52 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
@@ -206,6 +206,9 @@ public class TabletStatusBarService extends StatusBarService {
// The navigation buttons
mNavigationArea = sb.findViewById(R.id.navigationArea);
+ // set the initial view visibility
+ setAreThereNotifications();
+
// Add the windows
addPanelWindows();
@@ -318,6 +321,8 @@ public class TabletStatusBarService extends StatusBarService {
} else {
tick(notification);
}
+
+ setAreThereNotifications();
}
public void updateNotification(IBinder key, StatusBarNotification notification) {
@@ -387,11 +392,14 @@ public class TabletStatusBarService extends StatusBarService {
addNotificationViews(key, notification);
}
// TODO: ticker; immersive mode
+
+ setAreThereNotifications();
}
public void removeNotification(IBinder key) {
if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ") // TODO");
removeNotificationViews(key);
+ setAreThereNotifications();
}
public void disable(int state) {
@@ -495,6 +503,41 @@ public class TabletStatusBarService extends StatusBarService {
}
}
+ private void setAreThereNotifications() {
+ final boolean hasClearable = mNotns.hasClearableItems();
+
+ //Slog.d(TAG, "setAreThereNotifications hasClerable=" + hasClearable);
+
+ // Show or hide the "Clear all" button. Note that we don't do an animation
+ // if it's not on screen, so that if someone opens the bar right then they
+ // don't see the animation in progress.
+ // (no ongoing notifications are clearable)
+ if (hasClearable) {
+ if (mNotificationButtons.getVisibility() == View.VISIBLE) {
+ setViewVisibility(mClearButton, View.VISIBLE, R.anim.notification_buttons_in);
+ } else {
+ mClearButton.setVisibility(View.VISIBLE);
+ }
+ } else {
+ if (mNotificationButtons.getVisibility() == View.VISIBLE) {
+ setViewVisibility(mClearButton, View.GONE, R.anim.notification_buttons_out);
+ } else {
+ mClearButton.setVisibility(View.GONE);
+ }
+ }
+
+ /*
+ mOngoingTitle.setVisibility(ongoing ? View.VISIBLE : View.GONE);
+ mLatestTitle.setVisibility(latest ? View.VISIBLE : View.GONE);
+
+ if (ongoing || latest) {
+ mNoNotificationsTitle.setVisibility(View.GONE);
+ } else {
+ mNoNotificationsTitle.setVisibility(View.VISIBLE);
+ }
+ */
+ }
+
public void notificationIconsClicked(View v) {
if (DEBUG) Slog.d(TAG, "clicked notification icons");
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) {
@@ -690,19 +733,23 @@ public class TabletStatusBarService extends StatusBarService {
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false);
View vetoButton = row.findViewById(R.id.veto);
- final String _pkg = sbn.pkg;
- final String _tag = sbn.tag;
- final int _id = sbn.id;
- vetoButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- try {
- mBarService.onNotificationClear(_pkg, _tag, _id);
- } catch (RemoteException ex) {
- // system process is dead if we're here.
+ if (entry.notification.isClearable()) {
+ final String _pkg = sbn.pkg;
+ final String _tag = sbn.tag;
+ final int _id = sbn.id;
+ vetoButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ try {
+ mBarService.onNotificationClear(_pkg, _tag, _id);
+ } catch (RemoteException ex) {
+ // system process is dead if we're here.
+ }
+ // animateCollapse();
}
-// animateCollapse();
- }
- });
+ });
+ } else {
+ vetoButton.setVisibility(View.INVISIBLE);
+ }
// bind the click event to the content area
ViewGroup content = (ViewGroup)row.findViewById(R.id.content);
@@ -790,6 +837,7 @@ public class TabletStatusBarService extends StatusBarService {
private void setViewVisibility(View v, int vis, int anim) {
if (v.getVisibility() != vis) {
+ //Slog.d(TAG, "setViewVisibility vis=" + (vis == View.VISIBLE) + " v=" + v);
v.setAnimation(AnimationUtils.loadAnimation((Context)this, anim));
v.setVisibility(vis);
}