手机插上USB连上PC,下拉通知栏中通知的图标和背景颜色与其他通知不同
时间:10-02
整理:3721RD
点击:
手机插上USB连上PC,下拉通知栏中"USB Connected"通知的图标和背景颜色与其他通知不同
1.这是google default design.
2.在notification.java中,会判断当前notification的优先级,如果优先级小于PRIORITY_LOW,则
为其单独设置颜色和背景图片,如下:
if (mPriority < PRIORITY_LOW) {
contentView.setInt(R.id.icon,
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
contentView.setInt(R.id.status_bar_latest_event_content,
"setBackgroundResource", R.drawable.notification_bg_low);
}
3. 如果优先级不小于PRIORITY_LOW,则通知的使用的resource分别是
R.drawable.notification_template_icon_bg和R.drawable.Notification_bg.
1.这是google default design.
2.在notification.java中,会判断当前notification的优先级,如果优先级小于PRIORITY_LOW,则
为其单独设置颜色和背景图片,如下:
if (mPriority < PRIORITY_LOW) {
contentView.setInt(R.id.icon,
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
contentView.setInt(R.id.status_bar_latest_event_content,
"setBackgroundResource", R.drawable.notification_bg_low);
}
3. 如果优先级不小于PRIORITY_LOW,则通知的使用的resource分别是
R.drawable.notification_template_icon_bg和R.drawable.Notification_bg.
学习了,目前我们在5.1碰到了同样的问题
