Skip to content

Commit e95658c

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
New backgrounds for notifications.
Note that PRIORITY_MIN notifications have a special background treatment. Bug: 6418617 Change-Id: I5f96330fcc53ac39e80a025baa0c134bd1e971b8
1 parent f4299bd commit e95658c

26 files changed

+91
-17
lines changed

core/java/android/app/Notification.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,12 @@ public void setLatestEventInfo(Context context,
796796
if (this.icon != 0) {
797797
contentView.setImageViewResource(R.id.icon, this.icon);
798798
}
799+
if (priority < PRIORITY_LOW) {
800+
contentView.setInt(R.id.icon,
801+
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
802+
contentView.setInt(R.id.status_bar_latest_event_content,
803+
"setBackgroundResource", R.drawable.notification_bg_low);
804+
}
799805
if (contentTitle != null) {
800806
contentView.setTextViewText(R.id.title, contentTitle);
801807
}
@@ -1364,6 +1370,12 @@ private RemoteViews applyStandardTemplate(int resId) {
13641370
contentView.setImageViewBitmap(R.id.icon, mLargeIcon);
13651371
smallIconImageViewId = R.id.right_icon;
13661372
}
1373+
if (mPriority < PRIORITY_LOW) {
1374+
contentView.setInt(R.id.icon,
1375+
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
1376+
contentView.setInt(R.id.status_bar_latest_event_content,
1377+
"setBackgroundResource", R.drawable.notification_bg_low);
1378+
}
13671379
if (mSmallIcon != 0) {
13681380
contentView.setImageViewResource(smallIconImageViewId, mSmallIcon);
13691381
contentView.setViewVisibility(smallIconImageViewId, View.VISIBLE);
176 Bytes
Loading
181 Bytes
Loading
176 Bytes
Loading
180 Bytes
Loading
165 Bytes
Loading
169 Bytes
Loading
165 Bytes
Loading
171 Bytes
Loading
200 Bytes
Loading

0 commit comments

Comments
 (0)