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

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

[Notif redesign] Update conversation info design

I previously thought I'd changed the main guts layout behind a separate
flag instead of the templates one, but since it looks like I didn't...
I guess we can just roll with the same templates flag ¯\_(ツ)_/¯

Note that notification_2025_conversation_info.xml is a fork of
notification_conversation_info.xml.

Bug: 394822197
Test: tested manually
Flag: android.app.notifications_redesign_templates
Change-Id: I96545e967aa89665ade9e3493c1329b554a1d55a
parent 122c10f8
Loading
Loading
Loading
Loading
+399 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 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.systemui.statusbar.notification.row.NotificationConversationInfo
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:id="@+id/notification_guts"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusable="true"
    android:clipChildren="true"
    android:clipToPadding="true"
    android:orientation="vertical"
    android:paddingStart="@*android:dimen/notification_2025_margin">

    <!-- Package Info -->
    <LinearLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="true">
        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:layout_marginTop="@*android:dimen/notification_2025_margin"
            android:layout_marginEnd="@*android:dimen/notification_2025_margin"
            >

            <ImageView
                android:id="@+id/conversation_icon"
                android:layout_width="@*android:dimen/notification_2025_icon_circle_size"
                android:layout_height="@*android:dimen/notification_2025_icon_circle_size"
                android:background="@*android:drawable/notification_icon_circle"
                android:clipToOutline="true"
                android:scaleType="centerCrop"
                android:importantForAccessibility="no"
                />

            <FrameLayout
                android:id="@+id/conversation_icon_badge"
                android:layout_width="@*android:dimen/notification_2025_conversation_icon_badge_size"
                android:layout_height="@*android:dimen/notification_2025_conversation_icon_badge_size"
                android:layout_marginTop="@*android:dimen/notification_2025_conversation_icon_badge_position"
                android:layout_marginStart="@*android:dimen/notification_2025_conversation_icon_badge_position"
                android:clipChildren="false"
                android:clipToPadding="false"
                >
                <ImageView
                    android:id="@+id/conversation_icon_badge_bg"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:src="@*android:drawable/conversation_badge_background"
                    android:forceHasOverlappingRendering="false"
                    />
                <ImageView
                    android:id="@+id/conversation_icon_badge_icon"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_margin="@*android:dimen/notification_2025_conversation_icon_badge_padding"
                    android:layout_gravity="center"
                    android:forceHasOverlappingRendering="false"
                    />
                <ImageView
                    android:id="@+id/conversation_icon_badge_ring"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:src="@*android:drawable/conversation_badge_ring"
                    android:forceHasOverlappingRendering="false"
                    android:clipToPadding="false"
                    android:scaleType="center"
                    />
            </FrameLayout>
        </FrameLayout>
        <LinearLayout
            android:id="@+id/names"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:orientation="vertical"
            android:layout_height="wrap_content"
            android:layout_marginTop="@*android:dimen/notification_2025_margin"
            android:minHeight="@*android:dimen/notification_2025_icon_circle_size">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:orientation="horizontal">
                <TextView
                    android:id="@+id/parent_channel_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:textDirection="locale"
                    android:layout_weight="1"
                    style="@style/TextAppearance.NotificationImportanceChannel"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="@style/TextAppearance.NotificationImportanceHeader"
                    android:visibility="gone"
                    android:layout_marginStart="2dp"
                    android:layout_marginEnd="2dp"
                    android:text="@*android:string/notification_header_divider_symbol" />
                <TextView
                    android:id="@+id/name"
                    android:visibility="gone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    style="@style/TextAppearance.NotificationImportanceChannel"/>
            </LinearLayout>
            <TextView
                android:id="@+id/group_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:textDirection="locale"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"/>
            <TextView
                android:id="@+id/pkg_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.NotificationImportanceApp"
                android:ellipsize="end"
                android:textDirection="locale"
                android:maxLines="1"/>
            <TextView
                android:id="@+id/delegate_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.NotificationImportanceHeader"
                android:layout_marginStart="2dp"
                android:layout_marginEnd="2dp"
                android:ellipsize="end"
                android:textDirection="locale"
                android:text="@string/notification_delegate_header"
                android:maxLines="1" />

        </LinearLayout>

        <!-- end aligned fields -->
        <ImageButton
            android:id="@+id/feedback"
            android:layout_width="@dimen/notification_2025_guts_button_size"
            android:layout_height="@dimen/notification_2025_guts_button_size"
            android:visibility="gone"
            android:background="@drawable/ripple_drawable"
            android:contentDescription="@string/notification_guts_bundle_feedback"
            android:src="@*android:drawable/ic_feedback"
            android:paddingTop="@*android:dimen/notification_2025_margin"
            android:tint="@androidprv:color/materialColorPrimary"/>

        <!-- System notification settings -->
        <ImageButton
            android:id="@+id/info"
            android:layout_width="@dimen/notification_2025_guts_button_size"
            android:layout_height="@dimen/notification_2025_guts_button_size"
            android:contentDescription="@string/notification_more_settings"
            android:background="@drawable/ripple_drawable"
            android:src="@drawable/ic_settings"
            android:padding="@*android:dimen/notification_2025_margin"
            android:tint="@androidprv:color/materialColorPrimary" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/inline_controls"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@*android:dimen/notification_2025_margin"
        android:layout_marginTop="@*android:dimen/notification_2025_margin"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="vertical">

        <!-- Non configurable app/channel text. appears instead of @+id/interruptiveness_settings-->
        <TextView
            android:id="@+id/non_configurable_text"
            android:text="@string/notification_unblockable_desc"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@*android:style/TextAppearance.DeviceDefault.Notification" />

        <!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
        <TextView
            android:id="@+id/non_configurable_multichannel_text"
            android:text="@string/notification_multichannel_desc"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@*android:style/TextAppearance.DeviceDefault.Notification" />

        <LinearLayout
            android:id="@+id/interruptiveness_settings"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical">

            <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
                android:id="@+id/priority"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingVertical="@dimen/notification_2025_importance_button_padding_vertical"
                android:paddingHorizontal="@dimen/notification_2025_importance_button_padding_horizontal"
                android:gravity="center_vertical"
                android:clickable="true"
                android:focusable="true"
                android:background="@drawable/notification_2025_guts_priority_button_bg"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/priority_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingEnd="@*android:dimen/notification_2025_margin"
                    android:src="@drawable/ic_important_outline"
                    android:background="@android:color/transparent"
                    android:tint="@color/notification_guts_priority_contents"
                    android:clickable="false"
                    android:focusable="false"/>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:gravity="center"
                    >
                    <TextView
                        android:id="@+id/priority_label"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:clickable="false"
                        android:focusable="false"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceButton"
                        android:text="@string/notification_priority_title"/>
                    <TextView
                        android:id="@+id/priority_summary"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:visibility="gone"
                        android:clickable="false"
                        android:focusable="false"
                        android:ellipsize="end"
                        android:maxLines="4"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"/>
                </LinearLayout>
            </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>

            <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
                android:id="@+id/default_behavior"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/notification_importance_button_separation"
                android:paddingVertical="@dimen/notification_2025_importance_button_padding_vertical"
                android:paddingHorizontal="@dimen/notification_2025_importance_button_padding_horizontal"
                android:gravity="center_vertical"
                android:clickable="true"
                android:focusable="true"
                android:background="@drawable/notification_2025_guts_priority_button_bg"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/default_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingEnd="@*android:dimen/notification_2025_margin"
                    android:src="@drawable/ic_notifications_alert"
                    android:background="@android:color/transparent"
                    android:tint="@color/notification_guts_priority_contents"
                    android:clickable="false"
                    android:focusable="false"/>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:gravity="center"
                    >
                    <TextView
                        android:id="@+id/default_label"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:clickable="false"
                        android:focusable="false"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceButton"
                        android:text="@string/notification_alert_title"/>
                    <TextView
                        android:id="@+id/default_summary"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:visibility="gone"
                        android:text="@string/notification_channel_summary_default"
                        android:clickable="false"
                        android:focusable="false"
                        android:ellipsize="end"
                        android:maxLines="4"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"/>
                </LinearLayout>
            </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>

            <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
                android:id="@+id/silence"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/notification_importance_button_separation"
                android:paddingVertical="@dimen/notification_2025_importance_button_padding_vertical"
                android:paddingHorizontal="@dimen/notification_2025_importance_button_padding_horizontal"
                android:gravity="center_vertical"
                android:clickable="true"
                android:focusable="true"
                android:background="@drawable/notification_2025_guts_priority_button_bg"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/silence_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingEnd="@*android:dimen/notification_2025_margin"
                    android:src="@drawable/ic_notifications_silence"
                    android:background="@android:color/transparent"
                    android:tint="@color/notification_guts_priority_contents"
                    android:clickable="false"
                    android:focusable="false"/>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:gravity="center"
                    >
                    <TextView
                        android:id="@+id/silence_label"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:clickable="false"
                        android:focusable="false"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceButton"
                        android:text="@string/notification_silence_title"/>
                    <TextView
                        android:id="@+id/silence_summary"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:visibility="gone"
                        android:text="@string/notification_conversation_summary_low"
                        android:clickable="false"
                        android:focusable="false"
                        android:ellipsize="end"
                        android:maxLines="4"
                        android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"/>
                </LinearLayout>
            </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>

        </LinearLayout>

        <RelativeLayout
            android:id="@+id/bottom_buttons"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@*android:dimen/notification_2025_margin"
            android:minHeight="@dimen/notification_2025_guts_button_size"
            >
            <TextView
                android:id="@+id/done"
                android:text="@string/inline_ok_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingTop="8dp"
                android:paddingBottom="@*android:dimen/notification_2025_margin"
                android:gravity="center"
                android:minWidth="@dimen/notification_2025_min_tap_target_size"
                android:minHeight="@dimen/notification_2025_min_tap_target_size"
                style="@style/TextAppearance.NotificationInfo.Button"
                android:textSize="@*android:dimen/notification_2025_action_text_size"/>
        </RelativeLayout>
    </LinearLayout>

</com.android.systemui.statusbar.notification.row.NotificationConversationInfo>
+4 −1
Original line number Diff line number Diff line
@@ -713,9 +713,12 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
    static NotificationMenuItem createConversationItem(Context context) {
        Resources res = context.getResources();
        String infoDescription = res.getString(R.string.notification_menu_gear_description);
        int layoutId = notificationsRedesignTemplates()
                ? R.layout.notification_2025_conversation_info
                : R.layout.notification_conversation_info;
        NotificationConversationInfo infoContent =
                (NotificationConversationInfo) LayoutInflater.from(context).inflate(
                        R.layout.notification_conversation_info, null, false);
                        layoutId, null, false);
        return new NotificationMenuItem(context, infoDescription, infoContent,
                NotificationMenuItem.OMIT_FROM_SWIPE_MENU);
    }