Show a screenshot above.
ICS has problem of notification's background color, white.
Conditions the problem:
- set RemoteViews when Notificaiton created
- Application's targetSdkVersion is lower than "9"(=GingerBread).
Cause of the problem
Show frameworks source in Android-4.0.3_r1.\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone
- PhoneStatusBar.java
private boolean inflateViews(NotificationData.Entry entry, ViewGroup parent) { StatusBarNotification sbn = entry.notification; RemoteViews remoteViews = sbn.notification.contentView; if (remoteViews == null) { return false; } : : : applyLegacyRowBackground(sbn, content); entry.row = row; entry.content = content; entry.expanded = expanded; entry.largeIcon = largeIcon; return true; } void applyLegacyRowBackground(StatusBarNotification sbn, View content) { if (sbn.notification.contentView.getLayoutId() != com.android.internal.R.layout.status_bar_latest_event_content) { int version = 0; try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.pkg, 0); version = info.targetSdkVersion; } catch (NameNotFoundException ex) { Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.pkg, ex); } if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { content.setBackgroundResource(R.drawable.notification_row_legacy_bg); } else { content.setBackgroundResource(R.drawable.notification_row_bg); } } }Check to process of setting Notificaion Background Color.
if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { content.setBackgroundResource(R.drawable.notification_row_legacy_bg); } else { content.setBackgroundResource(R.drawable.notification_row_bg); }
If TargetSdkVersion is lower than Build.VERSION_CODES.GINGERBREAD(APILevel9), set R.drawable.notification_row_legacy_bg!!
Check it!!
\frameworks\base\packages\SystemUI\res\drawable
- notification_row_legacy_bg.xml
\frameworks\base\packages\SystemUI\res\values\
- colors.xml
This comment has been removed by a blog administrator.
ReplyDeleteAll are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, keep on updates
ReplyDeletemotorola service center near me
motorola mobile service centre in chennai
moto g service center in chennai
real estate whatsapp groups
ReplyDelete