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

Commit 6c943596 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge changes I13f7ef44,I9381c1fe into main

* changes:
  [Notif redesign] Circular icons for Call Notifications
  [Notif redesign] Circular icons for Messaging Notifs
parents d248e392 c24b4175
Loading
Loading
Loading
Loading
+26 −6
Original line number Diff line number Diff line
@@ -817,16 +817,16 @@ public class Notification implements Parcelable
                     R.layout.notification_2025_template_expanded_base,
                     R.layout.notification_2025_template_heads_up_base,
                     R.layout.notification_2025_template_header,
                     R.layout.notification_2025_template_conversation,
                     R.layout.notification_2025_template_collapsed_call,
                     R.layout.notification_2025_template_expanded_call,
                     R.layout.notification_2025_template_collapsed_messaging,
                     R.layout.notification_2025_template_collapsed_media,
                     R.layout.notification_template_material_big_picture,
                     R.layout.notification_template_material_big_text,
                     R.layout.notification_template_material_inbox,
                     R.layout.notification_template_material_big_messaging,
                     R.layout.notification_template_material_conversation,
                     R.layout.notification_template_material_big_media,
                     R.layout.notification_template_material_call,
                     R.layout.notification_template_material_big_call,
                     R.layout.notification_template_header -> true;
                case R.layout.notification_template_material_progress -> Flags.apiRichOngoing();
                default -> false;
@@ -7593,8 +7593,28 @@ public class Notification implements Parcelable
        }
        private int getConversationLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_conversation;
            } else {
                return R.layout.notification_template_material_conversation;
            }
        }
        private int getCollapsedCallLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_collapsed_call;
            } else {
                return R.layout.notification_template_material_call;
            }
        }
        private int getExpandedCallLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_call;
            } else {
                return R.layout.notification_template_material_big_call;
            }
        }
        private int getProgressLayoutResource() {
            return R.layout.notification_template_material_progress;
@@ -10944,10 +10964,10 @@ public class Notification implements Parcelable
            final RemoteViews contentView;
            if (isCollapsed) {
                contentView = mBuilder.applyStandardTemplate(
                        R.layout.notification_template_material_call, p, null /* result */);
                        mBuilder.getCollapsedCallLayoutResource(), p, null /* result */);
            } else {
                contentView = mBuilder.applyStandardTemplateWithActions(
                        R.layout.notification_template_material_big_call, p, null /* result */);
                    mBuilder.getExpandedCallLayoutResource(), p, null /* result */);
            }
            // Bind some extra conversation-specific header fields.
+9 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ public class MessagingGroup extends NotificationOptimizedLinearLayout implements
        MessagingGroup createdGroup = sInstancePool.acquire();
        if (createdGroup == null) {
            createdGroup = (MessagingGroup) LayoutInflater.from(layout.getContext()).inflate(
                    R.layout.notification_template_messaging_group, layout,
                    getMessagingGroupLayoutResource(), layout,
                    false);
            createdGroup.addOnLayoutChangeListener(MessagingLayout.MESSAGING_PROPERTY_ANIMATOR);
        }
@@ -269,6 +269,14 @@ public class MessagingGroup extends NotificationOptimizedLinearLayout implements
        return createdGroup;
    }

    private static int getMessagingGroupLayoutResource() {
        if (Flags.notificationsRedesignTemplates()) {
            return R.layout.notification_2025_messaging_group;
        } else {
            return R.layout.notification_template_messaging_group;
        }
    }

    public void removeMessage(MessagingMessage messagingMessage,
            ArrayList<MessagingLinearLayout.MessagingChild> toRecycle) {
        View view = messagingMessage.getView();
+54 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations underthe License
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/conversation_face_pile"
    android:layout_width="@dimen/conversation_avatar_size"
    android:layout_height="@dimen/conversation_avatar_size"
    android:forceHasOverlappingRendering="false"
    >
    <ImageView
        android:id="@+id/conversation_face_pile_top"
        android:layout_width="@dimen/messaging_avatar_size"
        android:layout_height="@dimen/messaging_avatar_size"
        android:scaleType="centerCrop"
        android:layout_gravity="end|top"
        android:background="@drawable/notification_icon_circle"
        android:clipToOutline="true"
        />
    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|bottom">
        <ImageView
            android:id="@+id/conversation_face_pile_bottom_background"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/conversation_badge_background"
            />
        <ImageView
            android:id="@+id/conversation_face_pile_bottom"
            android:layout_width="@dimen/messaging_avatar_size"
            android:layout_height="@dimen/messaging_avatar_size"
            android:scaleType="centerCrop"
            android:layout_gravity="center"
            android:background="@drawable/notification_icon_circle"
            android:clipToOutline="true"
            />
    </FrameLayout>
</FrameLayout>
+104 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/conversation_icon_container"
    android:layout_width="@dimen/conversation_content_start"
    android:layout_height="wrap_content"
    android:gravity="start|top"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingTop="20dp"
    android:paddingBottom="16dp"
    android:importantForAccessibility="no"
    >

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:layout_gravity="top|center_horizontal"
        >

        <!-- Big icon: 48x48, 12dp padding top, 16dp padding sides -->
        <com.android.internal.widget.CachingIconView
            android:id="@+id/conversation_icon"
            android:layout_width="@dimen/conversation_avatar_size"
            android:layout_height="@dimen/conversation_avatar_size"
            android:layout_marginLeft="@dimen/conversation_badge_protrusion"
            android:layout_marginRight="@dimen/conversation_badge_protrusion"
            android:layout_marginBottom="@dimen/conversation_badge_protrusion"
            android:background="@drawable/notification_icon_circle"
            android:clipToOutline="true"
            android:scaleType="centerCrop"
            android:importantForAccessibility="no"
            />

        <ViewStub
            android:layout="@layout/notification_2025_conversation_face_pile_layout"
            android:layout_width="@dimen/conversation_avatar_size"
            android:layout_height="@dimen/conversation_avatar_size"
            android:layout_marginLeft="@dimen/conversation_badge_protrusion"
            android:layout_marginRight="@dimen/conversation_badge_protrusion"
            android:layout_marginBottom="@dimen/conversation_badge_protrusion"
            android:id="@+id/conversation_face_pile"
            />

        <FrameLayout
            android:id="@+id/conversation_icon_badge"
            android:layout_width="@dimen/conversation_icon_size_badged"
            android:layout_height="@dimen/conversation_icon_size_badged"
            android:layout_gravity="end|bottom"
            android:clipChildren="false"
            android:clipToPadding="false"
            >

            <com.android.internal.widget.CachingIconView
                android:id="@+id/conversation_icon_badge_bg"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:src="@drawable/conversation_badge_background"
                android:forceHasOverlappingRendering="false"
                android:scaleType="center"
                />

            <com.android.internal.widget.NotificationRowIconView
                android:id="@+id/icon"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="4dp"
                android:layout_gravity="center"
                android:forceHasOverlappingRendering="false"
                />

            <com.android.internal.widget.CachingIconView
                android:id="@+id/conversation_icon_badge_ring"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/conversation_badge_ring"
                android:visibility="gone"
                android:forceHasOverlappingRendering="false"
                android:clipToPadding="false"
                android:scaleType="center"
                />
        </FrameLayout>
    </FrameLayout>
</FrameLayout>
+80 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<!-- extends LinearLayout -->
<com.android.internal.widget.MessagingGroup
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
    <FrameLayout
        android:id="@+id/message_icon_container"
        android:layout_width="@dimen/conversation_content_start"
        android:layout_height="wrap_content">
        <ImageView
            android:layout_gravity="top|center_horizontal"
            android:id="@+id/message_icon"
            android:layout_width="@dimen/messaging_avatar_size"
            android:layout_height="@dimen/messaging_avatar_size"
            android:background="@drawable/notification_icon_circle"
            android:clipToOutline="true"
            android:scaleType="centerCrop"
            android:importantForAccessibility="no" />
    </FrameLayout>
    <com.android.internal.widget.RemeasuringLinearLayout
        android:id="@+id/messaging_group_content_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:baselineAligned="true"
        android:orientation="vertical">
        <com.android.internal.widget.ImageFloatingTextView
            android:id="@+id/message_name"
            style="@style/Widget.DeviceDefault.Notification.MessagingName"
            android:layout_width="wrap_content"
            android:textAlignment="viewStart"
        />
        <com.android.internal.widget.MessagingLinearLayout
            android:id="@+id/group_message_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/notification_text_margin_top"
            android:spacing="2dp" />
    </com.android.internal.widget.RemeasuringLinearLayout>
    <FrameLayout
        android:id="@+id/messaging_group_icon_container"
        android:layout_width="@dimen/messaging_avatar_size"
        android:layout_height="@dimen/messaging_avatar_size"
        android:layout_marginStart="12dp"
        android:visibility="gone"/>
    <FrameLayout
        android:id="@+id/messaging_group_sending_progress_container"
        android:layout_width="@dimen/messaging_group_sending_progress_size"
        android:layout_height="@dimen/messaging_avatar_size"
        android:layout_marginStart="12dp"
        android:layout_gravity="top"
        android:visibility="gone">
        <ProgressBar
            android:id="@+id/messaging_group_sending_progress"
            android:layout_height="@dimen/messaging_group_sending_progress_size"
            android:layout_width="@dimen/messaging_group_sending_progress_size"
            android:layout_gravity="center"
            android:indeterminate="true"
            style="?android:attr/progressBarStyleSmall" />
    </FrameLayout>
</com.android.internal.widget.MessagingGroup>
Loading