Loading core/java/android/app/Notification.java +19 −9 Original line number Diff line number Diff line Loading @@ -6678,7 +6678,8 @@ public class Notification implements Parcelable public RemoteViews makeContentView(boolean increasedHeight) { mBuilder.mOriginalActions = mBuilder.mActions; mBuilder.mActions = new ArrayList<>(); RemoteViews remoteViews = makeMessagingView(true /* isCollapsed */); RemoteViews remoteViews = makeMessagingView(true /* displayImagesAtEnd */, true /* showReplyIcon */); mBuilder.mActions = mBuilder.mOriginalActions; mBuilder.mOriginalActions = null; return remoteViews; Loading Loading @@ -6765,11 +6766,19 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeBigContentView() { return makeMessagingView(false /* isCollapsed */); return makeMessagingView(false /* displayImagesAtEnd */, false /* showReplyIcon */); } /** * Create a messaging layout. * * @param displayImagesAtEnd should images be displayed at the end of the content instead * of inline. * @param showReplyIcon Should the reply affordance be shown at the end of the notification * @return the created remoteView. */ @NonNull private RemoteViews makeMessagingView(boolean isCollapsed) { private RemoteViews makeMessagingView(boolean displayImagesAtEnd, boolean showReplyIcon) { CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; Loading @@ -6780,24 +6789,24 @@ public class Notification implements Parcelable nameReplacement = conversationTitle; conversationTitle = null; } boolean hideLargeIcon = !isCollapsed || isOneToOne; boolean hideLargeIcon = !showReplyIcon || isOneToOne; RemoteViews contentView = mBuilder.applyStandardTemplateWithActions( mBuilder.getMessagingLayoutResource(), mBuilder.mParams.reset().hasProgress(false).title(conversationTitle).text(null) .hideLargeIcon(hideLargeIcon) .headerTextSecondary(conversationTitle) .alwaysShowReply(isCollapsed)); .alwaysShowReply(showReplyIcon)); addExtras(mBuilder.mN.extras); // also update the end margin if there is an image int endMargin = R.dimen.notification_content_margin_end; if (isCollapsed) { if (showReplyIcon) { endMargin = R.dimen.notification_content_plus_picture_margin_end; } contentView.setViewLayoutMarginEndDimen(R.id.notification_main_column, endMargin); contentView.setInt(R.id.status_bar_latest_event_content, "setLayoutColor", mBuilder.resolveContrastColor()); contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsCollapsed", isCollapsed); contentView.setBoolean(R.id.status_bar_latest_event_content, "setDisplayImagesAtEnd", displayImagesAtEnd); contentView.setIcon(R.id.status_bar_latest_event_content, "setLargeIcon", mBuilder.mN.mLargeIcon); contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement", Loading Loading @@ -6864,7 +6873,8 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { RemoteViews remoteViews = makeMessagingView(true /* isCollapsed */); RemoteViews remoteViews = makeMessagingView(true /* displayImagesAtEnd */, false /* showReplyIcon */); remoteViews.setInt(R.id.notification_messaging, "setMaxDisplayedLines", 1); return remoteViews; } Loading core/java/com/android/internal/widget/MessagingGroup.java +5 −5 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou private boolean mIsHidingAnimated; private boolean mNeedsGeneratedAvatar; private Notification.Person mSender; private boolean mAvatarsAtEnd; private boolean mImagesAtEnd; private ViewGroup mImageContainer; private MessagingImageMessage mIsolatedMessage; private boolean mTransformingImages; Loading Loading @@ -342,7 +342,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mAddedMessages.add(message); } boolean isImage = message instanceof MessagingImageMessage; if (mAvatarsAtEnd && isImage) { if (mImagesAtEnd && isImage) { isolatedMessage = (MessagingImageMessage) message; } else { if (removeFromParentIfDifferent(message, mMessageContainer)) { Loading Loading @@ -474,9 +474,9 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mTransformingImages = transformingImages; } public void setDisplayAvatarsAtEnd(boolean atEnd) { if (mAvatarsAtEnd != atEnd) { mAvatarsAtEnd = atEnd; public void setDisplayImagesAtEnd(boolean atEnd) { if (mImagesAtEnd != atEnd) { mImagesAtEnd = atEnd; mImageContainer.setVisibility(atEnd ? View.VISIBLE : View.GONE); } } Loading core/java/com/android/internal/widget/MessagingLayout.java +4 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class MessagingLayout extends FrameLayout { private ArrayList<MessagingGroup> mAddedGroups = new ArrayList<>(); private Notification.Person mUser; private CharSequence mNameReplacement; private boolean mIsCollapsed; private boolean mDisplayImagesAtEnd; public MessagingLayout(@NonNull Context context) { super(context); Loading Loading @@ -128,8 +128,8 @@ public class MessagingLayout extends FrameLayout { } @RemotableViewMethod public void setIsCollapsed(boolean isCollapsed) { mIsCollapsed = isCollapsed; public void setDisplayImagesAtEnd(boolean atEnd) { mDisplayImagesAtEnd = atEnd; } @RemotableViewMethod Loading Loading @@ -337,7 +337,7 @@ public class MessagingLayout extends FrameLayout { newGroup = MessagingGroup.createGroup(mMessagingLinearLayout); mAddedGroups.add(newGroup); } newGroup.setDisplayAvatarsAtEnd(mIsCollapsed); newGroup.setDisplayImagesAtEnd(mDisplayImagesAtEnd); newGroup.setLayoutColor(mLayoutColor); Notification.Person sender = senders.get(groupIndex); CharSequence nameOverride = null; Loading Loading
core/java/android/app/Notification.java +19 −9 Original line number Diff line number Diff line Loading @@ -6678,7 +6678,8 @@ public class Notification implements Parcelable public RemoteViews makeContentView(boolean increasedHeight) { mBuilder.mOriginalActions = mBuilder.mActions; mBuilder.mActions = new ArrayList<>(); RemoteViews remoteViews = makeMessagingView(true /* isCollapsed */); RemoteViews remoteViews = makeMessagingView(true /* displayImagesAtEnd */, true /* showReplyIcon */); mBuilder.mActions = mBuilder.mOriginalActions; mBuilder.mOriginalActions = null; return remoteViews; Loading Loading @@ -6765,11 +6766,19 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeBigContentView() { return makeMessagingView(false /* isCollapsed */); return makeMessagingView(false /* displayImagesAtEnd */, false /* showReplyIcon */); } /** * Create a messaging layout. * * @param displayImagesAtEnd should images be displayed at the end of the content instead * of inline. * @param showReplyIcon Should the reply affordance be shown at the end of the notification * @return the created remoteView. */ @NonNull private RemoteViews makeMessagingView(boolean isCollapsed) { private RemoteViews makeMessagingView(boolean displayImagesAtEnd, boolean showReplyIcon) { CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; Loading @@ -6780,24 +6789,24 @@ public class Notification implements Parcelable nameReplacement = conversationTitle; conversationTitle = null; } boolean hideLargeIcon = !isCollapsed || isOneToOne; boolean hideLargeIcon = !showReplyIcon || isOneToOne; RemoteViews contentView = mBuilder.applyStandardTemplateWithActions( mBuilder.getMessagingLayoutResource(), mBuilder.mParams.reset().hasProgress(false).title(conversationTitle).text(null) .hideLargeIcon(hideLargeIcon) .headerTextSecondary(conversationTitle) .alwaysShowReply(isCollapsed)); .alwaysShowReply(showReplyIcon)); addExtras(mBuilder.mN.extras); // also update the end margin if there is an image int endMargin = R.dimen.notification_content_margin_end; if (isCollapsed) { if (showReplyIcon) { endMargin = R.dimen.notification_content_plus_picture_margin_end; } contentView.setViewLayoutMarginEndDimen(R.id.notification_main_column, endMargin); contentView.setInt(R.id.status_bar_latest_event_content, "setLayoutColor", mBuilder.resolveContrastColor()); contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsCollapsed", isCollapsed); contentView.setBoolean(R.id.status_bar_latest_event_content, "setDisplayImagesAtEnd", displayImagesAtEnd); contentView.setIcon(R.id.status_bar_latest_event_content, "setLargeIcon", mBuilder.mN.mLargeIcon); contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement", Loading Loading @@ -6864,7 +6873,8 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { RemoteViews remoteViews = makeMessagingView(true /* isCollapsed */); RemoteViews remoteViews = makeMessagingView(true /* displayImagesAtEnd */, false /* showReplyIcon */); remoteViews.setInt(R.id.notification_messaging, "setMaxDisplayedLines", 1); return remoteViews; } Loading
core/java/com/android/internal/widget/MessagingGroup.java +5 −5 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou private boolean mIsHidingAnimated; private boolean mNeedsGeneratedAvatar; private Notification.Person mSender; private boolean mAvatarsAtEnd; private boolean mImagesAtEnd; private ViewGroup mImageContainer; private MessagingImageMessage mIsolatedMessage; private boolean mTransformingImages; Loading Loading @@ -342,7 +342,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mAddedMessages.add(message); } boolean isImage = message instanceof MessagingImageMessage; if (mAvatarsAtEnd && isImage) { if (mImagesAtEnd && isImage) { isolatedMessage = (MessagingImageMessage) message; } else { if (removeFromParentIfDifferent(message, mMessageContainer)) { Loading Loading @@ -474,9 +474,9 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mTransformingImages = transformingImages; } public void setDisplayAvatarsAtEnd(boolean atEnd) { if (mAvatarsAtEnd != atEnd) { mAvatarsAtEnd = atEnd; public void setDisplayImagesAtEnd(boolean atEnd) { if (mImagesAtEnd != atEnd) { mImagesAtEnd = atEnd; mImageContainer.setVisibility(atEnd ? View.VISIBLE : View.GONE); } } Loading
core/java/com/android/internal/widget/MessagingLayout.java +4 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class MessagingLayout extends FrameLayout { private ArrayList<MessagingGroup> mAddedGroups = new ArrayList<>(); private Notification.Person mUser; private CharSequence mNameReplacement; private boolean mIsCollapsed; private boolean mDisplayImagesAtEnd; public MessagingLayout(@NonNull Context context) { super(context); Loading Loading @@ -128,8 +128,8 @@ public class MessagingLayout extends FrameLayout { } @RemotableViewMethod public void setIsCollapsed(boolean isCollapsed) { mIsCollapsed = isCollapsed; public void setDisplayImagesAtEnd(boolean atEnd) { mDisplayImagesAtEnd = atEnd; } @RemotableViewMethod Loading Loading @@ -337,7 +337,7 @@ public class MessagingLayout extends FrameLayout { newGroup = MessagingGroup.createGroup(mMessagingLinearLayout); mAddedGroups.add(newGroup); } newGroup.setDisplayAvatarsAtEnd(mIsCollapsed); newGroup.setDisplayImagesAtEnd(mDisplayImagesAtEnd); newGroup.setLayoutColor(mLayoutColor); Notification.Person sender = senders.get(groupIndex); CharSequence nameOverride = null; Loading