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

Commit 59fa0b77 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Update spacing of collapsed group children

This is to match the redesign specs, including aligning to the new,
larger "small" icon.

Note that notification_2025_hybrid and
notification_2025_hybrid_conversation are forks of hybrid_notification
and hybrid_conversation_notification respectively.

Bug: 378660052
Test: visual test, screenshot tests to come later
Flag: android.app.notifications_redesign_templates
Change-Id: I18ded714d191f7dcc082806f0b4984c29e66b9de
parent c0dd0da4
Loading
Loading
Loading
Loading
+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(
+2 −3
Original line number Diff line number Diff line
@@ -63,9 +63,8 @@ public class HybridGroupManager {
    private HybridNotificationView inflateHybridView(View contentView, ViewGroup parent) {
        Trace.beginSection("HybridGroupManager#inflateHybridView");
        LayoutInflater inflater = LayoutInflater.from(mContext);
        int layout = contentView instanceof ConversationLayout
                ? R.layout.hybrid_conversation_notification
                : R.layout.hybrid_notification;
        int layout = HybridNotificationView.getLayoutResource(
                /* isConversation = */ contentView instanceof ConversationLayout);
        HybridNotificationView hybrid = (HybridNotificationView)
                inflater.inflate(layout, parent, false);
        parent.addView(hybrid);
Loading