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

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

Merge changes I835d947a,Ic50a6fe9,I6ee981e0,I9582e490,Iea8327e2 into main

* changes:
  [Notif redesign] Increase min height of notif
  [Notif redesign] Reduce headerless notif margins
  [Notif redesign] Align actions to larger icon
  [Notif redesign] Align actions in old media notif
  [Notif redesign] Bigger "small" icon in expanded notifs
parents 3b80c8fc b33444e6
Loading
Loading
Loading
Loading
+49 −18
Original line number Diff line number Diff line
@@ -821,14 +821,14 @@ public class Notification implements Parcelable
                     R.layout.notification_2025_template_collapsed_call,
                     R.layout.notification_2025_template_expanded_call,
                     R.layout.notification_2025_template_collapsed_messaging,
                     R.layout.notification_2025_template_expanded_messaging,
                     R.layout.notification_2025_template_collapsed_media,
                     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_big_messaging,
                     R.layout.notification_template_material_big_media,
                     R.layout.notification_template_header -> true;
                case R.layout.notification_template_material_progress -> Flags.apiRichOngoing();
                     R.layout.notification_2025_template_expanded_media,
                     R.layout.notification_2025_template_expanded_big_picture,
                     R.layout.notification_2025_template_expanded_big_text,
                     R.layout.notification_2025_template_expanded_inbox -> true;
                case R.layout.notification_2025_template_expanded_progress
                        -> Flags.apiRichOngoing();
                default -> false;
            };
        }
@@ -5964,7 +5964,7 @@ public class Notification implements Parcelable
        private static void setHeaderlessVerticalMargins(RemoteViews contentView,
                StandardTemplateParams p, boolean hasSecondLine) {
            if (!p.mHeaderless) {
            if (Flags.notificationsRedesignTemplates() || !p.mHeaderless) {
                return;
            }
            int marginDimen = hasSecondLine
@@ -6445,10 +6445,13 @@ public class Notification implements Parcelable
                // Clear view padding to allow buttons to start on the left edge.
                // This must be done before 'setEmphasizedMode' which sets top/bottom margins.
                big.setViewPadding(R.id.actions, 0, 0, 0, 0);
                // Add an optional indent that will make buttons start at the correct column when
                // there is enough space to do so (and fall back to the left edge if not).
                if (!Flags.notificationsRedesignTemplates()) {
                    // Add an optional indent that will make buttons start at the correct column
                    // when there is enough space to do so (and fall back to the left edge if not).
                    // This is handled directly in NotificationActionListLayout in the new design.
                    big.setInt(R.id.actions, "setCollapsibleIndentDimen",
                            R.dimen.call_notification_collapsible_indent);
                }
                if (evenlyDividedCallStyleActionLayout()) {
                    if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) {
                        Log.d(TAG, "setting evenly divided mode on action list");
@@ -7561,16 +7564,28 @@ public class Notification implements Parcelable
        }
        private int getBigPictureLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_big_picture;
            } else {
                return R.layout.notification_template_material_big_picture;
            }
        }
        private int getBigTextLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_big_text;
            } else {
                return R.layout.notification_template_material_big_text;
            }
        }
        private int getInboxLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_inbox;
            } else {
                return R.layout.notification_template_material_inbox;
            }
        }
        private int getCollapsedMessagingLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
@@ -7581,8 +7596,12 @@ public class Notification implements Parcelable
        }
        private int getExpandedMessagingLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_messaging;
            } else {
                return R.layout.notification_template_material_big_messaging;
            }
        }
        private int getCollapsedMediaLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
@@ -7592,6 +7611,14 @@ public class Notification implements Parcelable
            }
        }
        private int getExpandedMediaLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_media;
            } else {
                return R.layout.notification_template_material_big_media;
            }
        }
        private int getConversationLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_conversation;
@@ -7617,8 +7644,12 @@ public class Notification implements Parcelable
        }
        private int getProgressLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_progress;
            } else {
                return R.layout.notification_template_material_progress;
            }
        }
        private int getActionLayoutResource() {
            return R.layout.notification_material_action;
@@ -10541,7 +10572,7 @@ public class Notification implements Parcelable
                    .fillTextsFrom(mBuilder);
            TemplateBindResult result = new TemplateBindResult();
            RemoteViews template = mBuilder.applyStandardTemplate(
                    R.layout.notification_template_material_big_media, p , result);
                    mBuilder.getExpandedMediaLayoutResource(), p , result);
            for (int i = 0; i < MAX_MEDIA_BUTTONS; i++) {
                if (i < actionCount) {
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.widget;

import static android.app.Flags.notificationsRedesignTemplates;
import static android.widget.flags.Flags.conversationLayoutUseMaximumChildHeight;

import static com.android.internal.widget.MessagingGroup.IMAGE_DISPLAY_LOCATION_EXTERNAL;
@@ -692,7 +693,7 @@ public class ConversationLayout extends FrameLayout
    }

    private void updateActionListPadding() {
        if (mActions != null) {
        if (!notificationsRedesignTemplates() && mActions != null) {
            mActions.setCollapsibleIndentDimen(R.dimen.call_notification_collapsible_indent);
        }
    }
+6 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.app.Notification.CallStyle.DEBUG_NEW_ACTION_LAYOUT;
import static android.app.Flags.evenlyDividedCallStyleActionLayout;

import android.annotation.DimenRes;
import android.app.Flags;
import android.app.Notification;
import android.content.Context;
import android.content.res.TypedArray;
@@ -58,7 +59,7 @@ public class NotificationActionListLayout extends LinearLayout {
    private int mEmphasizedPaddingBottom;
    private int mEmphasizedHeight;
    private int mRegularHeight;
    @DimenRes private int mCollapsibleIndentDimen = R.dimen.notification_actions_padding_start;
    @DimenRes private int mCollapsibleIndentDimen;
    int mNumNotGoneChildren;
    int mNumPriorityChildren;

@@ -73,6 +74,10 @@ public class NotificationActionListLayout extends LinearLayout {
    public NotificationActionListLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);

        mCollapsibleIndentDimen = Flags.notificationsRedesignTemplates()
                ? R.dimen.notification_2025_actions_margin_start
                : R.dimen.notification_actions_padding_start;

        int[] attrIds = { android.R.attr.gravity };
        TypedArray ta = context.obtainStyledAttributes(attrs, attrIds, defStyleAttr, defStyleRes);
        mGravity = ta.getInt(0, 0);
+4 −4
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:minHeight="@dimen/notification_headerless_min_height"
    android:minHeight="@dimen/notification_2025_min_height"
    android:tag="base"
    >

@@ -72,8 +72,8 @@
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="1"
            android:layout_marginBottom="@dimen/notification_headerless_margin_twoline"
            android:layout_marginTop="@dimen/notification_headerless_margin_twoline"
            android:layout_marginBottom="@dimen/notification_2025_margin"
            android:layout_marginTop="@dimen/notification_2025_margin"
            android:orientation="vertical"
            >

@@ -81,7 +81,7 @@
                android:id="@+id/notification_top_line"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/notification_headerless_line_height"
                android:minHeight="@dimen/notification_2025_content_min_height"
                android:clipChildren="false"
                android:theme="@style/Theme.DeviceDefault.Notification"
                >
+2 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="88dp"
        android:minHeight="@dimen/notification_2025_min_height"
        android:orientation="horizontal"
        >

@@ -43,8 +43,7 @@
            android:layout_weight="1"
            android:layout_marginStart="@dimen/conversation_content_start"
            android:orientation="vertical"
            android:minHeight="68dp"
            android:paddingBottom="@dimen/notification_headerless_margin_twoline"
            android:paddingBottom="@dimen/notification_2025_margin"
            >

            <include
Loading