Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95804578 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Use circular bg for left icon in messaging notifs

Since we now enforce a circular crop for avatars, we should do the same
for the left_icon since that also appears in the same fashion in
grouped messaging notifications.

Also made sure we're not actually showing the left_icon when we don't
have something to show there - since otherwise we were just displaying
an empty circle. The "apply" boolean here (remamed from showLeftIcon) is
true when we know the small icons are the same, but doesn't necessarily
mean we need to show the left icon.

Bug: 406224300
Flag: android.app.notifications_redesign_templates
Test: tested manually with a mix of conversations and non-conversations
(both individually and grouped together), in light and dark mode; also
made sure normal grouped notifs with large icons are unchanged

Change-Id: I7bae9492895976a7208a39fe1b92ed78e57e640f
parent 4f066759
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -209,6 +209,15 @@ public class ConversationLayout extends FrameLayout
        mImportanceRingView = findViewById(R.id.conversation_icon_badge_ring);
        mConversationIconBadge = findViewById(R.id.conversation_icon_badge);
        mConversationIconBadgeBg = findViewById(R.id.conversation_icon_badge_bg);
        if (notificationsRedesignTemplates()) {
            // The left_icon in the header has the default rounded square background. Make sure
            // we're using the circular background instead.
            ImageView leftIcon = findViewById(R.id.left_icon);
            if (leftIcon != null) {
                leftIcon.setBackgroundResource(
                        R.drawable.notification_2025_conversation_icon_background);
            }
        }
        mIcon.setOnVisibilityChangedListener((visibility) -> {

            // Let's hide the background directly or in an animated way
+9 −0
Original line number Diff line number Diff line
@@ -120,6 +120,15 @@ public class MessagingLayout extends FrameLayout
        mImageMessageContainer = findViewById(R.id.conversation_image_message_container);
        mRightIconView = findViewById(R.id.right_icon);
        mExpandButton = findViewById(R.id.expand_button);
        if (notificationsRedesignTemplates()) {
            // The left_icon in the header has the default rounded square background. Make sure
            // we're using the circular background instead.
            ImageView leftIcon = findViewById(R.id.left_icon);
            if (leftIcon != null) {
                leftIcon.setBackgroundResource(
                        R.drawable.notification_2025_conversation_icon_background);
            }
        }
        // We still want to clip, but only on the top, since views can temporarily out of bounds
        // during transitions.
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
                android:layout_height="@dimen/notification_2025_left_icon_size"
                android:layout_alignParentStart="true"
                android:layout_margin="@dimen/notification_2025_margin"
                android:background="@drawable/notification_large_icon_outline"
                android:background="@drawable/notification_2025_conversation_icon_background"
                android:clipToOutline="true"
                android:importantForAccessibility="no"
                android:scaleType="centerCrop"
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
                android:layout_height="@dimen/notification_2025_left_icon_size"
                android:layout_alignParentStart="true"
                android:layout_margin="@dimen/notification_2025_margin"
                android:background="@drawable/notification_large_icon_outline"
                android:background="@drawable/notification_2025_conversation_icon_background"
                android:clipToOutline="true"
                android:importantForAccessibility="no"
                android:scaleType="centerCrop"
+1 −0
Original line number Diff line number Diff line
@@ -4232,6 +4232,7 @@
  <java-symbol type="id" name="snooze_button" />
  <java-symbol type="dimen" name="text_size_body_2_material" />
  <java-symbol type="dimen" name="notification_icon_circle_size" />
  <java-symbol type="drawable" name="notification_2025_conversation_icon_background" />
  <java-symbol type="drawable" name="notification_icon_circle" />
  <java-symbol type="drawable" name="notification_progress_icon_background" />
  <java-symbol type="dimen" name="messaging_avatar_size" />
Loading