Merge "Don't show X for notifications that can't be cleared"

This commit is contained in:
Joe Onorato
2010-09-27 15:55:23 -07:00
committed by Android (Google) Code Review
4 changed files with 20 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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"

View File

@@ -733,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);