Loading core/java/com/android/internal/widget/ConversationLayout.java +10 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ public class ConversationLayout extends FrameLayout private CharSequence mFallbackChatName; private CharSequence mFallbackGroupChatName; private CharSequence mConversationTitle; private int mMessageSpacingStandard; private int mMessageSpacingGroup; private int mNotificationHeaderExpandedPadding; private View mConversationHeader; private View mContentContainer; Loading Loading @@ -241,6 +243,10 @@ public class ConversationLayout extends FrameLayout mContentContainer = findViewById(R.id.notification_action_list_margin_target); mExpandButtonAndContentContainer = findViewById(R.id.expand_button_and_content_container); mExpandButton = findViewById(R.id.expand_button); mMessageSpacingStandard = getResources().getDimensionPixelSize( R.dimen.notification_messaging_spacing); mMessageSpacingGroup = getResources().getDimensionPixelSize( R.dimen.notification_messaging_spacing_conversation_group); mNotificationHeaderExpandedPadding = getResources().getDimensionPixelSize( R.dimen.conversation_header_expanded_padding_end); mContentMarginEnd = getResources().getDimensionPixelSize( Loading Loading @@ -699,6 +705,10 @@ public class ConversationLayout extends FrameLayout } private void updatePaddingsBasedOnContentAvailability() { // groups have avatars that need more spacing mMessagingLinearLayout.setSpacing( mIsOneToOne ? mMessageSpacingStandard : mMessageSpacingGroup); int messagingPadding = mIsOneToOne || mIsCollapsed ? 0 // Add some extra padding to the messages, since otherwise it will overlap with the Loading core/java/com/android/internal/widget/MessagingLinearLayout.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.widget; import android.annotation.Nullable; import android.annotation.Px; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; Loading Loading @@ -251,6 +252,16 @@ public class MessagingLinearLayout extends ViewGroup { return super.drawChild(canvas, child, drawingTime); } /** * Set the spacing to be applied between views. */ public void setSpacing(@Px int spacing) { if (mSpacing != spacing) { mSpacing = spacing; requestLayout(); } } @Override public LayoutParams generateLayoutParams(AttributeSet attrs) { return new LayoutParams(mContext, attrs); Loading core/res/res/values/dimens.xml +10 −7 Original line number Diff line number Diff line Loading @@ -367,6 +367,9 @@ <!-- The spacing between messages in Notification.MessagingStyle --> <dimen name="notification_messaging_spacing">6dp</dimen> <!-- The spacing between messages in Notification.MessagingStyle --> <dimen name="notification_messaging_spacing_conversation_group">24dp</dimen> <!-- The rounding for messaging images --> <dimen name="messaging_image_rounding">4dp</dimen> Loading Loading @@ -760,7 +763,7 @@ <!-- The maximum size of the grayscale icon --> <dimen name="notification_grayscale_icon_max_size">256dp</dimen> <dimen name="messaging_avatar_size">36dp</dimen> <dimen name="messaging_avatar_size">48dp</dimen> <dimen name="conversation_avatar_size">48dp</dimen> <!-- start margin of the icon circle in the conversation's skin of the header --> <dimen name="conversation_icon_circle_start">28dp</dimen> Loading @@ -779,17 +782,17 @@ <!-- size of the face pile icons --> <dimen name="conversation_face_pile_avatar_size">32dp</dimen> <!-- size of the face pile icons when the group is expanded --> <dimen name="conversation_face_pile_avatar_size_group_expanded">25dp</dimen> <dimen name="conversation_face_pile_avatar_size_group_expanded">@dimen/conversation_face_pile_avatar_size</dimen> <!-- Side margins of the conversation badge in relation to the conversation icon when the group is expanded--> <dimen name="conversation_badge_side_margin_group_expanded">22dp</dimen> <dimen name="conversation_badge_side_margin_group_expanded">@dimen/conversation_badge_side_margin</dimen> <!-- Side margins of the conversation badge in relation to the conversation icon when the group is expanded--> <dimen name="conversation_badge_side_margin_group_expanded_face_pile">18dp</dimen> <dimen name="conversation_badge_side_margin_group_expanded_face_pile">@dimen/conversation_badge_side_margin</dimen> <!-- The width of the protection of the face pile layout--> <dimen name="conversation_face_pile_protection_width">2dp</dimen> <!-- The width of the protection of the face pile layout when expanded--> <dimen name="conversation_face_pile_protection_width_expanded">1dp</dimen> <dimen name="conversation_face_pile_protection_width_expanded">@dimen/conversation_face_pile_protection_width</dimen> <!-- The padding of the expanded message container--> <dimen name="expanded_group_conversation_message_padding">17dp</dimen> <dimen name="expanded_group_conversation_message_padding">32dp</dimen> <!-- The stroke width of the ring used to visually mark a conversation as important --> <dimen name="importance_ring_stroke_width">2dp</dimen> <!-- The maximum stroke width used for the animation shown when a conversation is marked as important --> Loading @@ -801,7 +804,7 @@ <dimen name="conversation_icon_container_top_padding">20dp</dimen> <!-- The top padding of the conversation icon container when the avatar is small--> <dimen name="conversation_icon_container_top_padding_small_avatar">9dp</dimen> <dimen name="conversation_icon_container_top_padding_small_avatar">8dp</dimen> <!-- The padding of the conversation header when expanded. This is calculated from the expand button size + notification_content_margin_end --> <dimen name="conversation_header_expanded_padding_end">38dp</dimen> Loading core/res/res/values/styles_device_defaults.xml +0 −4 Original line number Diff line number Diff line Loading @@ -302,10 +302,6 @@ easier. <style name="TextAppearance.DeviceDefault.Notification.Time" parent="TextAppearance.Material.Notification.Time"> <item name="fontFamily">@string/config_bodyFontFamily</item> </style> <style name="TextAppearance.DeviceDefault.Notification.Conversation.AppName" parent="TextAppearance.Material.Notification.Conversation.AppName"> <item name="fontFamily">@string/config_headlineFontFamilyMedium</item> </style> <style name="TextAppearance.DeviceDefault.Widget" parent="TextAppearance.Material.Widget"> <item name="fontFamily">@string/config_bodyFontFamily</item> </style> Loading core/res/res/values/styles_material.xml +0 −4 Original line number Diff line number Diff line Loading @@ -497,10 +497,6 @@ please see styles_device_defaults.xml. <!-- unused; keep identical to parent --> <style name="TextAppearance.Material.Notification.Emphasis"/> <style name="TextAppearance.Material.Notification.Conversation.AppName" parent="TextAppearance.Material.Notification.Title"> <item name="android:textSize">16sp</item> </style> <style name="TextAppearance.Material.ListItem" parent="TextAppearance.Material.Subhead" /> <style name="TextAppearance.Material.ListItemSecondary" parent="TextAppearance.Material.Body1" /> Loading Loading
core/java/com/android/internal/widget/ConversationLayout.java +10 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ public class ConversationLayout extends FrameLayout private CharSequence mFallbackChatName; private CharSequence mFallbackGroupChatName; private CharSequence mConversationTitle; private int mMessageSpacingStandard; private int mMessageSpacingGroup; private int mNotificationHeaderExpandedPadding; private View mConversationHeader; private View mContentContainer; Loading Loading @@ -241,6 +243,10 @@ public class ConversationLayout extends FrameLayout mContentContainer = findViewById(R.id.notification_action_list_margin_target); mExpandButtonAndContentContainer = findViewById(R.id.expand_button_and_content_container); mExpandButton = findViewById(R.id.expand_button); mMessageSpacingStandard = getResources().getDimensionPixelSize( R.dimen.notification_messaging_spacing); mMessageSpacingGroup = getResources().getDimensionPixelSize( R.dimen.notification_messaging_spacing_conversation_group); mNotificationHeaderExpandedPadding = getResources().getDimensionPixelSize( R.dimen.conversation_header_expanded_padding_end); mContentMarginEnd = getResources().getDimensionPixelSize( Loading Loading @@ -699,6 +705,10 @@ public class ConversationLayout extends FrameLayout } private void updatePaddingsBasedOnContentAvailability() { // groups have avatars that need more spacing mMessagingLinearLayout.setSpacing( mIsOneToOne ? mMessageSpacingStandard : mMessageSpacingGroup); int messagingPadding = mIsOneToOne || mIsCollapsed ? 0 // Add some extra padding to the messages, since otherwise it will overlap with the Loading
core/java/com/android/internal/widget/MessagingLinearLayout.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.widget; import android.annotation.Nullable; import android.annotation.Px; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; Loading Loading @@ -251,6 +252,16 @@ public class MessagingLinearLayout extends ViewGroup { return super.drawChild(canvas, child, drawingTime); } /** * Set the spacing to be applied between views. */ public void setSpacing(@Px int spacing) { if (mSpacing != spacing) { mSpacing = spacing; requestLayout(); } } @Override public LayoutParams generateLayoutParams(AttributeSet attrs) { return new LayoutParams(mContext, attrs); Loading
core/res/res/values/dimens.xml +10 −7 Original line number Diff line number Diff line Loading @@ -367,6 +367,9 @@ <!-- The spacing between messages in Notification.MessagingStyle --> <dimen name="notification_messaging_spacing">6dp</dimen> <!-- The spacing between messages in Notification.MessagingStyle --> <dimen name="notification_messaging_spacing_conversation_group">24dp</dimen> <!-- The rounding for messaging images --> <dimen name="messaging_image_rounding">4dp</dimen> Loading Loading @@ -760,7 +763,7 @@ <!-- The maximum size of the grayscale icon --> <dimen name="notification_grayscale_icon_max_size">256dp</dimen> <dimen name="messaging_avatar_size">36dp</dimen> <dimen name="messaging_avatar_size">48dp</dimen> <dimen name="conversation_avatar_size">48dp</dimen> <!-- start margin of the icon circle in the conversation's skin of the header --> <dimen name="conversation_icon_circle_start">28dp</dimen> Loading @@ -779,17 +782,17 @@ <!-- size of the face pile icons --> <dimen name="conversation_face_pile_avatar_size">32dp</dimen> <!-- size of the face pile icons when the group is expanded --> <dimen name="conversation_face_pile_avatar_size_group_expanded">25dp</dimen> <dimen name="conversation_face_pile_avatar_size_group_expanded">@dimen/conversation_face_pile_avatar_size</dimen> <!-- Side margins of the conversation badge in relation to the conversation icon when the group is expanded--> <dimen name="conversation_badge_side_margin_group_expanded">22dp</dimen> <dimen name="conversation_badge_side_margin_group_expanded">@dimen/conversation_badge_side_margin</dimen> <!-- Side margins of the conversation badge in relation to the conversation icon when the group is expanded--> <dimen name="conversation_badge_side_margin_group_expanded_face_pile">18dp</dimen> <dimen name="conversation_badge_side_margin_group_expanded_face_pile">@dimen/conversation_badge_side_margin</dimen> <!-- The width of the protection of the face pile layout--> <dimen name="conversation_face_pile_protection_width">2dp</dimen> <!-- The width of the protection of the face pile layout when expanded--> <dimen name="conversation_face_pile_protection_width_expanded">1dp</dimen> <dimen name="conversation_face_pile_protection_width_expanded">@dimen/conversation_face_pile_protection_width</dimen> <!-- The padding of the expanded message container--> <dimen name="expanded_group_conversation_message_padding">17dp</dimen> <dimen name="expanded_group_conversation_message_padding">32dp</dimen> <!-- The stroke width of the ring used to visually mark a conversation as important --> <dimen name="importance_ring_stroke_width">2dp</dimen> <!-- The maximum stroke width used for the animation shown when a conversation is marked as important --> Loading @@ -801,7 +804,7 @@ <dimen name="conversation_icon_container_top_padding">20dp</dimen> <!-- The top padding of the conversation icon container when the avatar is small--> <dimen name="conversation_icon_container_top_padding_small_avatar">9dp</dimen> <dimen name="conversation_icon_container_top_padding_small_avatar">8dp</dimen> <!-- The padding of the conversation header when expanded. This is calculated from the expand button size + notification_content_margin_end --> <dimen name="conversation_header_expanded_padding_end">38dp</dimen> Loading
core/res/res/values/styles_device_defaults.xml +0 −4 Original line number Diff line number Diff line Loading @@ -302,10 +302,6 @@ easier. <style name="TextAppearance.DeviceDefault.Notification.Time" parent="TextAppearance.Material.Notification.Time"> <item name="fontFamily">@string/config_bodyFontFamily</item> </style> <style name="TextAppearance.DeviceDefault.Notification.Conversation.AppName" parent="TextAppearance.Material.Notification.Conversation.AppName"> <item name="fontFamily">@string/config_headlineFontFamilyMedium</item> </style> <style name="TextAppearance.DeviceDefault.Widget" parent="TextAppearance.Material.Widget"> <item name="fontFamily">@string/config_bodyFontFamily</item> </style> Loading
core/res/res/values/styles_material.xml +0 −4 Original line number Diff line number Diff line Loading @@ -497,10 +497,6 @@ please see styles_device_defaults.xml. <!-- unused; keep identical to parent --> <style name="TextAppearance.Material.Notification.Emphasis"/> <style name="TextAppearance.Material.Notification.Conversation.AppName" parent="TextAppearance.Material.Notification.Title"> <item name="android:textSize">16sp</item> </style> <style name="TextAppearance.Material.ListItem" parent="TextAppearance.Material.Subhead" /> <style name="TextAppearance.Material.ListItemSecondary" parent="TextAppearance.Material.Body1" /> Loading