Merge "Always use Shortcut Icon in conversation if available" into rvc-dev am: cc1937581a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11662920 Change-Id: I150bd3a1810a5cc922313dd0958058338e70a721
This commit is contained in:
@@ -7625,9 +7625,8 @@ public class Notification implements Parcelable
|
|||||||
}
|
}
|
||||||
boolean isConversationLayout = mConversationType != CONVERSATION_TYPE_LEGACY;
|
boolean isConversationLayout = mConversationType != CONVERSATION_TYPE_LEGACY;
|
||||||
boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT;
|
boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT;
|
||||||
Icon largeIcon = isConversationLayout && mShortcutIcon != null
|
Icon conversationIcon = mShortcutIcon;
|
||||||
? mShortcutIcon
|
Icon largeIcon = mBuilder.mN.mLargeIcon;
|
||||||
: mBuilder.mN.mLargeIcon;
|
|
||||||
TemplateBindResult bindResult = new TemplateBindResult();
|
TemplateBindResult bindResult = new TemplateBindResult();
|
||||||
StandardTemplateParams p = mBuilder.mParams.reset()
|
StandardTemplateParams p = mBuilder.mParams.reset()
|
||||||
.hasProgress(false)
|
.hasProgress(false)
|
||||||
@@ -7671,6 +7670,8 @@ public class Notification implements Parcelable
|
|||||||
contentView.setCharSequence(R.id.status_bar_latest_event_content,
|
contentView.setCharSequence(R.id.status_bar_latest_event_content,
|
||||||
"setConversationTitle", conversationTitle);
|
"setConversationTitle", conversationTitle);
|
||||||
if (isConversationLayout) {
|
if (isConversationLayout) {
|
||||||
|
contentView.setIcon(R.id.status_bar_latest_event_content,
|
||||||
|
"setConversationIcon", conversationIcon);
|
||||||
contentView.setBoolean(R.id.status_bar_latest_event_content,
|
contentView.setBoolean(R.id.status_bar_latest_event_content,
|
||||||
"setIsImportantConversation", isImportantConversation);
|
"setIsImportantConversation", isImportantConversation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -480,23 +480,25 @@ public class ConversationLayout extends FrameLayout
|
|||||||
// (This usually happens for most 1:1 conversations)
|
// (This usually happens for most 1:1 conversations)
|
||||||
conversationText = messagingGroup.getSenderName();
|
conversationText = messagingGroup.getSenderName();
|
||||||
}
|
}
|
||||||
Icon avatarIcon = messagingGroup.getAvatarIcon();
|
if (mConversationIcon == null) {
|
||||||
if (avatarIcon == null) {
|
Icon avatarIcon = messagingGroup.getAvatarIcon();
|
||||||
avatarIcon = createAvatarSymbol(conversationText, "", mLayoutColor);
|
if (avatarIcon == null) {
|
||||||
|
avatarIcon = createAvatarSymbol(conversationText, "", mLayoutColor);
|
||||||
|
}
|
||||||
|
mConversationIcon = avatarIcon;
|
||||||
}
|
}
|
||||||
mConversationIcon = avatarIcon;
|
|
||||||
mConversationIconView.setImageIcon(mConversationIcon);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mLargeIcon != null) {
|
if (mConversationIcon == null && mLargeIcon != null) {
|
||||||
mConversationIcon = mLargeIcon;
|
mConversationIcon = mLargeIcon;
|
||||||
|
}
|
||||||
|
if (mConversationIcon != null) {
|
||||||
mConversationIconView.setVisibility(VISIBLE);
|
mConversationIconView.setVisibility(VISIBLE);
|
||||||
mConversationFacePile.setVisibility(GONE);
|
mConversationFacePile.setVisibility(GONE);
|
||||||
mConversationIconView.setImageIcon(mLargeIcon);
|
mConversationIconView.setImageIcon(mConversationIcon);
|
||||||
} else {
|
} else {
|
||||||
mConversationIcon = null;
|
|
||||||
mConversationIconView.setVisibility(GONE);
|
mConversationIconView.setVisibility(GONE);
|
||||||
// This will also inflate it!
|
// This will also inflate it!
|
||||||
mConversationFacePile.setVisibility(VISIBLE);
|
mConversationFacePile.setVisibility(VISIBLE);
|
||||||
@@ -709,6 +711,11 @@ public class ConversationLayout extends FrameLayout
|
|||||||
mLargeIcon = largeIcon;
|
mLargeIcon = largeIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RemotableViewMethod
|
||||||
|
public void setConversationIcon(Icon conversationIcon) {
|
||||||
|
mConversationIcon = conversationIcon;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the conversation title of this conversation.
|
* Sets the conversation title of this conversation.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user