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

Commit 9f05a45c authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Update partial conversation info design

Note that notification_2025_partial_conversation_info.xml is a fork of
partial_conversation_info.xml.

Bug: 394822197
Test: tested manually
Flag: android.app.notifications_redesign_templates
Change-Id: Ic2963d45160c1a4d2b7888bf5d753ca8326542e3
parent ada9f4ae
Loading
Loading
Loading
Loading
+181 −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.systemui.statusbar.notification.row.PartialConversationInfo
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/notification_guts"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusable="true"
    android:clipChildren="false"
    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">
        <ImageView
            android:id="@+id/icon"
            android:layout_width="@*android:dimen/notification_2025_icon_circle_size"
            android:layout_height="@*android:dimen/notification_2025_icon_circle_size"
            android:layout_marginTop="@*android:dimen/notification_2025_margin"
            android:layout_marginEnd="@*android:dimen/notification_2025_margin" />
        <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">
            <TextView
                android:id="@+id/name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:textDirection="locale"
                style="@style/TextAppearance.NotificationImportanceChannel"/>
            <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/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_20dp"
            android:src="@drawable/ic_settings"
            android:tint="?android:attr/colorAccent" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/inline_controls"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingEnd="@dimen/notification_shade_content_margin_horizontal"
        android:layout_marginTop="@dimen/notification_guts_option_vertical_padding"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="vertical">

        <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
            android:id="@+id/settings_link"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/notification_importance_button_padding"
            android:clickable="true"
            android:focusable="true"
            android:background="@drawable/notification_guts_priority_button_bg"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipChildren="false"
                android:clipToPadding="false"
                android:layout_centerVertical="true"
                android:orientation="horizontal">
                <ImageView
                    android:layout_height="match_parent"
                    android:layout_width="wrap_content"
                    android:contentDescription="@null"
                    android:src="@drawable/ic_info"
                    android:tint="?android:attr/textColorPrimary"
                    android:layout_marginEnd="8dp"/>
                <TextView
                    android:id="@+id/non_configurable_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textDirection="locale"
                    style="@style/TextAppearance.NotificationImportanceChannelGroup" />
            </LinearLayout>
        </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>

        <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"
            android:layout_gravity="center_vertical"
            >
            <TextView
                android:id="@+id/inline_dismiss"
                android:text="@string/notification_inline_dismiss"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:gravity="start|center_vertical"
                android:minWidth="@dimen/notification_2025_min_tap_target_size"
                android:minHeight="@dimen/notification_2025_min_tap_target_size"
                android:maxWidth="200dp"
                android:paddingEnd="@dimen/notification_importance_button_padding"
                android:paddingTop="8dp"
                android:paddingBottom="@*android:dimen/notification_2025_margin"
                style="@style/TextAppearance.NotificationInfo.Button"
                android:textSize="@*android:dimen/notification_2025_action_text_size"/>
            <TextView
                android:id="@+id/turn_off_notifications"
                android:text="@string/inline_turn_off_notifications"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toEndOf="@id/inline_dismiss"
                android:gravity="start|center_vertical"
                android:minWidth="@dimen/notification_2025_min_tap_target_size"
                android:minHeight="@dimen/notification_2025_min_tap_target_size"
                android:maxWidth="200dp"
                android:paddingStart="@dimen/notification_importance_button_padding"
                android:paddingTop="8dp"
                android:paddingBottom="@*android:dimen/notification_2025_margin"
                style="@style/TextAppearance.NotificationInfo.Button"
                android:textSize="@*android:dimen/notification_2025_action_text_size"/>
            <TextView
                android:id="@+id/done"
                android:text="@string/inline_done_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:gravity="end|center_vertical"
                android:minWidth="@dimen/notification_2025_min_tap_target_size"
                android:minHeight="@dimen/notification_2025_min_tap_target_size"
                android:maxWidth="125dp"
                android:paddingTop="8dp"
                android:paddingBottom="@*android:dimen/notification_2025_margin"
                style="@style/TextAppearance.NotificationInfo.Button"
                android:textSize="@*android:dimen/notification_2025_action_text_size"/>
        </RelativeLayout>

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