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

Commit c07506b7 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge changes I18ded714,I560c6f7c into main

* changes:
  [Notif redesign] Update spacing of collapsed group children
  Use a switch statement instead of static list of layouts
parents c6bc983c 59fa0b77
Loading
Loading
Loading
Loading
+21 −9
Original line number Diff line number Diff line
@@ -811,20 +811,32 @@ public class Notification implements Parcelable
    }
    private static boolean isStandardLayout(int layoutId) {
        // TODO: b/359128724 - Add to static list when inlining the flag.
        if (Flags.notificationsRedesignTemplates()) {
            return switch (layoutId) {
                case R.layout.notification_2025_template_collapsed_base,
                     R.layout.notification_2025_template_header,
                     R.layout.notification_template_material_heads_up_base,
                     R.layout.notification_template_material_big_base,
                     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_messaging,
                     R.layout.notification_template_material_big_messaging,
                     R.layout.notification_template_material_conversation,
                     R.layout.notification_template_material_media,
                     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;
            };
        }
        if (Flags.apiRichOngoing()) {
            if (layoutId == R.layout.notification_template_material_progress) {
                return true;
            }
        }
        // TODO: b/378660052 - Add to static list when inlining the flag.
        if (Flags.notificationsRedesignTemplates()) {
            switch(layoutId) {
                case R.layout.notification_2025_template_collapsed_base:
                case R.layout.notification_2025_template_header:
                    return true;
            }
        }
        return STANDARD_LAYOUTS.contains(layoutId);
    }
+42 −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.systemui.statusbar.notification.row.HybridNotificationView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="bottom|start"
    android:paddingStart="@*android:dimen/notification_2025_content_margin_start"
    android:paddingEnd="12dp">
    <TextView
        android:id="@+id/notification_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Notification.Title"
        android:paddingEnd="4dp"
    />
    <TextView
        android:id="@+id/notification_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:paddingEnd="4dp"
        style="@*android:style/Widget.DeviceDefault.Notification.Text"
    />
</com.android.systemui.statusbar.notification.row.HybridNotificationView>
 No newline at end of file
+74 −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.systemui.statusbar.notification.row.HybridConversationNotificationView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical|start"
    android:paddingStart="@*android:dimen/notification_2025_content_margin_start"
    android:paddingEnd="12dp">

    <FrameLayout
        android:layout_width="@dimen/notification_2025_single_line_face_pile_size"
        android:layout_height="@dimen/notification_2025_single_line_face_pile_size"
        android:layout_marginEnd="8dp"
    >
        <ImageView
            android:id="@*android:id/conversation_icon"
            android:layout_width="@dimen/notification_2025_single_line_avatar_size"
            android:layout_height="@dimen/notification_2025_single_line_avatar_size"
            android:layout_gravity="center_vertical|end"
        />

        <ViewStub
            android:id="@*android:id/conversation_face_pile"
            android:layout="@*android:layout/conversation_face_pile_layout"
            android:layout_width="@dimen/notification_2025_single_line_face_pile_size"
            android:layout_height="@dimen/notification_2025_single_line_face_pile_size"
            android:layout_gravity="center_vertical|end"
        />
    </FrameLayout>

    <TextView
        android:id="@+id/notification_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:paddingEnd="4dp"
        android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Notification.Title"
    />

    <TextView
        android:id="@+id/conversation_notification_sender"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:paddingEnd="4dp"
        style="@*android:style/Widget.DeviceDefault.Notification.Text"
    />

    <TextView
        android:id="@+id/notification_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:paddingEnd="4dp"
        style="@*android:style/Widget.DeviceDefault.Notification.Text"
    />
</com.android.systemui.statusbar.notification.row.HybridConversationNotificationView>
+12 −0
Original line number Diff line number Diff line
@@ -788,6 +788,18 @@
    <!-- Size of an avatar shown on one-line (children of a group) conversation notifications -->
    <dimen name="conversation_single_line_avatar_size">24dp</dimen>

    <!-- Size of the face pile shown on one-line (children of a group) conversation notifications
         (2025 redesign version) -->
    <dimen name="notification_2025_single_line_face_pile_size">16dp</dimen>

    <!-- Size of the avatars within a face pile shown on one-line (children of a group) conversation
         notifications (2025 redesign version) -->
    <dimen name="notification_2025_single_line_face_pile_avatar_size">11dp</dimen>

    <!-- Size of an avatar shown on one-line (children of a group) conversation notifications
         (2025 redesign version) -->
    <dimen name="notification_2025_single_line_avatar_size">16dp</dimen>

    <!-- Border width for avatars in the face pile shown on one-line (children of a group) conversation notifications -->
    <dimen name="conversation_single_line_face_pile_protection_width">1dp</dimen>

+17 −6
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.notification.row;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Flags;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Icon;
@@ -93,12 +94,22 @@ public class HybridConversationNotificationView extends HybridNotificationView {
        }
        mConversationSenderName = requireViewById(R.id.conversation_notification_sender);
        applyTextColor(mConversationSenderName, mSecondaryTextColor);
        if (Flags.notificationsRedesignTemplates()) {
            mFacePileSize = getResources()
                    .getDimensionPixelSize(R.dimen.notification_2025_single_line_face_pile_size);
            mFacePileAvatarSize = getResources()
                    .getDimensionPixelSize(
                            R.dimen.notification_2025_single_line_face_pile_avatar_size);
            mSingleAvatarSize = getResources()
                    .getDimensionPixelSize(R.dimen.notification_2025_single_line_avatar_size);
        } else {
            mFacePileSize = getResources()
                    .getDimensionPixelSize(R.dimen.conversation_single_line_face_pile_size);
            mFacePileAvatarSize = getResources()
                    .getDimensionPixelSize(R.dimen.conversation_single_line_face_pile_avatar_size);
            mSingleAvatarSize = getResources()
                    .getDimensionPixelSize(R.dimen.conversation_single_line_avatar_size);
        }
        mFacePileProtectionWidth = getResources().getDimensionPixelSize(
                R.dimen.conversation_single_line_face_pile_protection_width);
        mTransformationHelper.setCustomTransformation(
Loading