Merge "Decorated custom views now behave better if no custom view is set" into nyc-dev
This commit is contained in:
@@ -4580,13 +4580,13 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
private void buildIntoRemoteViewContent(RemoteViews remoteViews,
|
private void buildIntoRemoteViewContent(RemoteViews remoteViews,
|
||||||
RemoteViews customContent) {
|
RemoteViews customContent) {
|
||||||
remoteViews.removeAllViews(R.id.notification_main_column);
|
if (customContent != null) {
|
||||||
// Need to clone customContent before adding, because otherwise it can no longer be
|
// Need to clone customContent before adding, because otherwise it can no longer be
|
||||||
// parceled independently of remoteViews.
|
// parceled independently of remoteViews.
|
||||||
if (customContent != null) {
|
|
||||||
customContent = customContent.clone();
|
customContent = customContent.clone();
|
||||||
}
|
remoteViews.removeAllViews(R.id.notification_main_column);
|
||||||
remoteViews.addView(R.id.notification_main_column, customContent);
|
remoteViews.addView(R.id.notification_main_column, customContent);
|
||||||
|
}
|
||||||
// also update the end margin if there is an image
|
// also update the end margin if there is an image
|
||||||
int endMargin = mBuilder.mContext.getResources().getDimensionPixelSize(
|
int endMargin = mBuilder.mContext.getResources().getDimensionPixelSize(
|
||||||
R.dimen.notification_content_margin_end);
|
R.dimen.notification_content_margin_end);
|
||||||
@@ -4689,13 +4689,13 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
private RemoteViews buildIntoRemoteView(RemoteViews remoteViews, int id,
|
private RemoteViews buildIntoRemoteView(RemoteViews remoteViews, int id,
|
||||||
RemoteViews customContent) {
|
RemoteViews customContent) {
|
||||||
remoteViews.removeAllViews(id);
|
if (customContent != null) {
|
||||||
// Need to clone customContent before adding, because otherwise it can no longer be
|
// Need to clone customContent before adding, because otherwise it can no longer be
|
||||||
// parceled independently of remoteViews.
|
// parceled independently of remoteViews.
|
||||||
if (customContent != null) {
|
|
||||||
customContent = customContent.clone();
|
customContent = customContent.clone();
|
||||||
}
|
remoteViews.removeAllViews(id);
|
||||||
remoteViews.addView(id, customContent);
|
remoteViews.addView(id, customContent);
|
||||||
|
}
|
||||||
return remoteViews;
|
return remoteViews;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user