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

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

[Notif redesign] Update compact HUNs

Note that notification_2025_template_compact_heads_up_base and
notification_2025_template_compact_heads_up_messaging are forks of
notification_template_material_compact_heads_up_base and
notification_template_material_messaging_compact_heads_up respectively.

The new layouts now:
- use the new expander design
- show the top line icons with font scaling
- use the larger font size for the title

The icon size remains the same.

Bug: 378660052
Test: visual test, screenshot tests to come later
Flag: android.app.notifications_redesign_templates
Change-Id: I1c605cb0ef470b17b7ea35b60ef54a67315fded1
parent c3dbfc57
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -7597,12 +7597,20 @@ public class Notification implements Parcelable
        }
        private int getCompactHeadsUpBaseLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_compact_heads_up_base;
            } else {
                return R.layout.notification_template_material_compact_heads_up_base;
            }
        }
        private int getMessagingCompactHeadsUpLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_compact_heads_up_messaging;
            } else {
                return R.layout.notification_template_material_messaging_compact_heads_up;
            }
        }
        private int getExpandedBaseLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
+89 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2025 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/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="@dimen/notification_header_height"
    android:clipChildren="false"
    android:tag="compactHUN"
    android:gravity="center_vertical"
    android:theme="@style/Theme.DeviceDefault.Notification"
    android:importantForAccessibility="no">
    <com.android.internal.widget.NotificationRowIconView
        android:id="@+id/icon"
        android:layout_width="@dimen/notification_icon_circle_size"
        android:layout_height="@dimen/notification_icon_circle_size"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:background="@drawable/notification_icon_circle"
        android:padding="@dimen/notification_icon_circle_padding"
        android:maxDrawableWidth="@dimen/notification_icon_circle_size"
        android:maxDrawableHeight="@dimen/notification_icon_circle_size"
        />
    <FrameLayout
        android:id="@+id/alternate_expand_target"
        android:layout_width="@dimen/notification_content_margin_start"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:importantForAccessibility="no"
        android:focusable="false"
        />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginStart="@dimen/notification_content_margin_start"
        android:orientation="horizontal"
        >
        <NotificationTopLineView
            android:id="@+id/notification_top_line"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_centerVertical="true"
            android:layout_weight="1"
            android:clipChildren="false"
            android:gravity="center_vertical"
            android:theme="@style/Theme.DeviceDefault.Notification"
            >
            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/notification_header_separating_margin"
                android:ellipsize="end"
                android:fadingEdge="horizontal"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Title"
                android:textSize="@dimen/notification_2025_title_text_size"
                />
            <include layout="@layout/notification_2025_top_line_views" />
        </NotificationTopLineView>
        <FrameLayout
            android:id="@+id/expand_button_touch_container"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:minWidth="@dimen/notification_content_margin_end"
            >
            <include layout="@layout/notification_2025_expand_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|end"
                />
        </FrameLayout>
    </LinearLayout>
</FrameLayout>
+116 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2025 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
  -->

<com.android.internal.widget.CompactMessagingLayout
    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="@dimen/notification_header_height"
    android:clipChildren="false"
    android:tag="compactMessagingHUN"
    android:gravity="center_vertical"
    android:theme="@style/Theme.DeviceDefault.Notification"
    android:importantForAccessibility="no">
    <com.android.internal.widget.NotificationRowIconView
        android:id="@+id/icon"
        android:layout_width="@dimen/notification_icon_circle_size"
        android:layout_height="@dimen/notification_icon_circle_size"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:background="@drawable/notification_icon_circle"
        android:padding="@dimen/notification_icon_circle_padding"
        android:maxDrawableWidth="@dimen/notification_icon_circle_size"
        android:maxDrawableHeight="@dimen/notification_icon_circle_size"
        />
    <com.android.internal.widget.CachingIconView
        android:id="@+id/conversation_icon"
        android:layout_width="@dimen/notification_icon_circle_size"
        android:layout_height="@dimen/notification_icon_circle_size"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:background="@drawable/notification_icon_circle"
        android:clipToOutline="true"
        android:maxDrawableWidth="@dimen/notification_icon_circle_size"
        android:maxDrawableHeight="@dimen/notification_icon_circle_size"
        android:scaleType="centerCrop"
        android:importantForAccessibility="no"
        />
    <ViewStub
        android:layout="@layout/conversation_face_pile_layout"
        android:layout_gravity="center_vertical|start"
        android:layout_width="@dimen/conversation_compact_face_pile_size"
        android:layout_height="@dimen/conversation_compact_face_pile_size"
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:id="@+id/conversation_face_pile"
        />
    <FrameLayout
        android:id="@+id/alternate_expand_target"
        android:layout_width="@dimen/notification_content_margin_start"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:importantForAccessibility="no"
        android:focusable="false"
        />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginStart="@dimen/notification_content_margin_start"
        android:orientation="horizontal"
        >
        <NotificationTopLineView
            android:id="@+id/notification_top_line"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_centerVertical="true"
            android:layout_weight="1"
            android:clipChildren="false"
            android:gravity="center_vertical"
            android:theme="@style/Theme.DeviceDefault.Notification"
            >
            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/notification_header_separating_margin"
                android:ellipsize="end"
                android:fadingEdge="horizontal"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Title"
                android:textSize="@dimen/notification_2025_title_text_size"
                />
            <include layout="@layout/notification_2025_top_line_views" />
        </NotificationTopLineView>
        <FrameLayout
            android:id="@+id/reply_action_container"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/notification_action_list_height"
            android:gravity="center_vertical"
            android:orientation="horizontal" />
        <FrameLayout
            android:id="@+id/expand_button_touch_container"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:minWidth="@dimen/notification_content_margin_end"
            >
            <include layout="@layout/notification_2025_expand_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|end"
                />
        </FrameLayout>
    </LinearLayout>
</com.android.internal.widget.CompactMessagingLayout>
+2 −0
Original line number Diff line number Diff line
@@ -2412,6 +2412,8 @@
  <java-symbol type="layout" name="notification_2025_template_collapsed_base" />
  <java-symbol type="layout" name="notification_2025_template_expanded_base" />
  <java-symbol type="layout" name="notification_2025_template_heads_up_base" />
  <java-symbol type="layout" name="notification_2025_template_compact_heads_up_base" />
  <java-symbol type="layout" name="notification_2025_template_compact_heads_up_messaging" />
  <java-symbol type="layout" name="notification_2025_template_header" />
  <java-symbol type="layout" name="notification_2025_template_collapsed_messaging" />
  <java-symbol type="layout" name="notification_2025_template_collapsed_media" />