Loading core/java/com/android/internal/widget/ConversationLayout.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class ConversationLayout extends FrameLayout private boolean mExpandable = true; private boolean mExpandable = true; private int mContentMarginEnd; private int mContentMarginEnd; private Rect mMessagingClipRect; private Rect mMessagingClipRect; private TextView mAppName; public ConversationLayout(@NonNull Context context) { public ConversationLayout(@NonNull Context context) { super(context); super(context); Loading Loading @@ -202,6 +203,7 @@ public class ConversationLayout extends FrameLayout R.string.conversation_title_fallback_one_to_one); R.string.conversation_title_fallback_one_to_one); mFallbackGroupChatName = getResources().getString( mFallbackGroupChatName = getResources().getString( R.string.conversation_title_fallback_group_chat); R.string.conversation_title_fallback_group_chat); mAppName = findViewById(R.id.app_name_text); } } @RemotableViewMethod @RemotableViewMethod Loading Loading @@ -384,6 +386,7 @@ public class ConversationLayout extends FrameLayout } } updateIconPositionAndSize(); updateIconPositionAndSize(); updateImageMessages(); updateImageMessages(); updateAppName(); } } private void updateImageMessages() { private void updateImageMessages() { Loading Loading @@ -462,6 +465,10 @@ public class ConversationLayout extends FrameLayout topView.setImageIcon(secondLastIcon); topView.setImageIcon(secondLastIcon); } } private void updateAppName() { mAppName.setVisibility(mIsCollapsed ? GONE : VISIBLE); } /** /** * update the icon position and sizing * update the icon position and sizing */ */ Loading core/res/res/layout/notification_template_material_conversation.xml +11 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,17 @@ /> /> </LinearLayout> </LinearLayout> <!-- App Name --> <TextView android:id="@+id/app_name_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/conversation_content_start" android:paddingBottom="16dp" android:textSize="12sp" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification" /> <!-- Messages --> <!-- Messages --> <com.android.internal.widget.MessagingLinearLayout <com.android.internal.widget.MessagingLinearLayout android:id="@+id/notification_messaging" android:id="@+id/notification_messaging" Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +13 −19 Original line number Original line Diff line number Diff line Loading @@ -52,28 +52,22 @@ class NotificationConversationTemplateViewWrapper constructor( private lateinit var imageMessageContainer: ViewGroup private lateinit var imageMessageContainer: ViewGroup private lateinit var messagingLinearLayout: MessagingLinearLayout private lateinit var messagingLinearLayout: MessagingLinearLayout private lateinit var importanceRing: View private lateinit var importanceRing: View private lateinit var appName: View private fun resolveViews() { private fun resolveViews() { messagingLinearLayout = conversationLayout.messagingLinearLayout messagingLinearLayout = conversationLayout.messagingLinearLayout imageMessageContainer = conversationLayout.imageMessageContainer imageMessageContainer = conversationLayout.imageMessageContainer conversationIcon = conversationLayout.requireViewById( with(conversationLayout) { com.android.internal.R.id.conversation_icon conversationIcon = requireViewById(com.android.internal.R.id.conversation_icon) ) conversationBadge = requireViewById(com.android.internal.R.id.conversation_icon_badge) conversationBadge = conversationLayout.requireViewById( conversationBadgeBg = com.android.internal.R.id.conversation_icon_badge requireViewById(com.android.internal.R.id.conversation_icon_badge_bg) ) expandButton = requireViewById(com.android.internal.R.id.expand_button) conversationBadgeBg = conversationLayout.requireViewById( expandButtonContainer = com.android.internal.R.id.conversation_icon_badge_bg requireViewById(com.android.internal.R.id.expand_button_container) ) importanceRing = requireViewById(com.android.internal.R.id.conversation_icon_badge_ring) expandButton = conversationLayout.requireViewById( appName = requireViewById(com.android.internal.R.id.app_name_text) com.android.internal.R.id.expand_button } ) expandButtonContainer = conversationLayout.requireViewById( com.android.internal.R.id.expand_button_container ) importanceRing = conversationLayout.requireViewById( com.android.internal.R.id.conversation_icon_badge_ring ) } } override fun onContentUpdated(row: ExpandableNotificationRow) { override fun onContentUpdated(row: ExpandableNotificationRow) { Loading @@ -87,7 +81,7 @@ class NotificationConversationTemplateViewWrapper constructor( // This also clears the existing types // This also clears the existing types super.updateTransformedTypes() super.updateTransformedTypes() addTransformedViews(messagingLinearLayout) addTransformedViews(messagingLinearLayout, appName) // Let's ignore the image message container since that is transforming as part of the // Let's ignore the image message container since that is transforming as part of the // messages already // messages already Loading Loading
core/java/com/android/internal/widget/ConversationLayout.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class ConversationLayout extends FrameLayout private boolean mExpandable = true; private boolean mExpandable = true; private int mContentMarginEnd; private int mContentMarginEnd; private Rect mMessagingClipRect; private Rect mMessagingClipRect; private TextView mAppName; public ConversationLayout(@NonNull Context context) { public ConversationLayout(@NonNull Context context) { super(context); super(context); Loading Loading @@ -202,6 +203,7 @@ public class ConversationLayout extends FrameLayout R.string.conversation_title_fallback_one_to_one); R.string.conversation_title_fallback_one_to_one); mFallbackGroupChatName = getResources().getString( mFallbackGroupChatName = getResources().getString( R.string.conversation_title_fallback_group_chat); R.string.conversation_title_fallback_group_chat); mAppName = findViewById(R.id.app_name_text); } } @RemotableViewMethod @RemotableViewMethod Loading Loading @@ -384,6 +386,7 @@ public class ConversationLayout extends FrameLayout } } updateIconPositionAndSize(); updateIconPositionAndSize(); updateImageMessages(); updateImageMessages(); updateAppName(); } } private void updateImageMessages() { private void updateImageMessages() { Loading Loading @@ -462,6 +465,10 @@ public class ConversationLayout extends FrameLayout topView.setImageIcon(secondLastIcon); topView.setImageIcon(secondLastIcon); } } private void updateAppName() { mAppName.setVisibility(mIsCollapsed ? GONE : VISIBLE); } /** /** * update the icon position and sizing * update the icon position and sizing */ */ Loading
core/res/res/layout/notification_template_material_conversation.xml +11 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,17 @@ /> /> </LinearLayout> </LinearLayout> <!-- App Name --> <TextView android:id="@+id/app_name_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/conversation_content_start" android:paddingBottom="16dp" android:textSize="12sp" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification" /> <!-- Messages --> <!-- Messages --> <com.android.internal.widget.MessagingLinearLayout <com.android.internal.widget.MessagingLinearLayout android:id="@+id/notification_messaging" android:id="@+id/notification_messaging" Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +13 −19 Original line number Original line Diff line number Diff line Loading @@ -52,28 +52,22 @@ class NotificationConversationTemplateViewWrapper constructor( private lateinit var imageMessageContainer: ViewGroup private lateinit var imageMessageContainer: ViewGroup private lateinit var messagingLinearLayout: MessagingLinearLayout private lateinit var messagingLinearLayout: MessagingLinearLayout private lateinit var importanceRing: View private lateinit var importanceRing: View private lateinit var appName: View private fun resolveViews() { private fun resolveViews() { messagingLinearLayout = conversationLayout.messagingLinearLayout messagingLinearLayout = conversationLayout.messagingLinearLayout imageMessageContainer = conversationLayout.imageMessageContainer imageMessageContainer = conversationLayout.imageMessageContainer conversationIcon = conversationLayout.requireViewById( with(conversationLayout) { com.android.internal.R.id.conversation_icon conversationIcon = requireViewById(com.android.internal.R.id.conversation_icon) ) conversationBadge = requireViewById(com.android.internal.R.id.conversation_icon_badge) conversationBadge = conversationLayout.requireViewById( conversationBadgeBg = com.android.internal.R.id.conversation_icon_badge requireViewById(com.android.internal.R.id.conversation_icon_badge_bg) ) expandButton = requireViewById(com.android.internal.R.id.expand_button) conversationBadgeBg = conversationLayout.requireViewById( expandButtonContainer = com.android.internal.R.id.conversation_icon_badge_bg requireViewById(com.android.internal.R.id.expand_button_container) ) importanceRing = requireViewById(com.android.internal.R.id.conversation_icon_badge_ring) expandButton = conversationLayout.requireViewById( appName = requireViewById(com.android.internal.R.id.app_name_text) com.android.internal.R.id.expand_button } ) expandButtonContainer = conversationLayout.requireViewById( com.android.internal.R.id.expand_button_container ) importanceRing = conversationLayout.requireViewById( com.android.internal.R.id.conversation_icon_badge_ring ) } } override fun onContentUpdated(row: ExpandableNotificationRow) { override fun onContentUpdated(row: ExpandableNotificationRow) { Loading @@ -87,7 +81,7 @@ class NotificationConversationTemplateViewWrapper constructor( // This also clears the existing types // This also clears the existing types super.updateTransformedTypes() super.updateTransformedTypes() addTransformedViews(messagingLinearLayout) addTransformedViews(messagingLinearLayout, appName) // Let's ignore the image message container since that is transforming as part of the // Let's ignore the image message container since that is transforming as part of the // messages already // messages already Loading