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

Commit 7eccbb71 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Notif redesign] Align messaging content under app icon" into main

parents 3aeace17 fbcb8acb
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -5999,8 +5999,10 @@ public class Notification implements Parcelable
            setHeaderlessVerticalMargins(contentView, p, hasSecondLine);
            // Update margins to leave space for the top line (but not for headerless views like
            // HUNS, which use a different layout that already accounts for that).
            if (Flags.notificationsRedesignTemplates() && !p.mHeaderless) {
            // HUNS, which use a different layout that already accounts for that). Templates that
            // have content that will be displayed under the small icon also use a different margin.
            if (Flags.notificationsRedesignTemplates()
                    && !p.mHeaderless && !p.mHasContentInLeftMargin) {
                int margin = getContentMarginTop(mContext,
                        R.dimen.notification_2025_content_margin_top);
                contentView.setViewLayoutMargin(R.id.notification_main_column,
@@ -9502,7 +9504,8 @@ public class Notification implements Parcelable
                    .text(null)
                    .hideLeftIcon(isOneToOne)
                    .hideRightIcon(hideRightIcons || isOneToOne)
                    .headerTextSecondary(isHeaderless ? null : conversationTitle);
                    .headerTextSecondary(isHeaderless ? null : conversationTitle)
                    .hasContentInLeftMargin(true);
            RemoteViews contentView = mBuilder.applyStandardTemplateWithActions(
                    isConversationLayout
                            ? mBuilder.getConversationLayoutResource()
@@ -14673,6 +14676,7 @@ public class Notification implements Parcelable
        Icon mPromotedPicture;
        boolean mCallStyleActions;
        boolean mAllowTextWithProgress;
        boolean mHasContentInLeftMargin;
        int mTitleViewId;
        int mTextViewId;
        @Nullable CharSequence mTitle;
@@ -14698,6 +14702,7 @@ public class Notification implements Parcelable
            mPromotedPicture = null;
            mCallStyleActions = false;
            mAllowTextWithProgress = false;
            mHasContentInLeftMargin = false;
            mTitleViewId = R.id.title;
            mTextViewId = R.id.text;
            mTitle = null;
@@ -14764,6 +14769,11 @@ public class Notification implements Parcelable
            return this;
        }
        public StandardTemplateParams hasContentInLeftMargin(boolean hasContentInLeftMargin) {
            mHasContentInLeftMargin = hasContentInLeftMargin;
            return this;
        }
        final StandardTemplateParams hideSnoozeButton(boolean hideSnoozeButton) {
            this.mHideSnoozeButton = hideSnoozeButton;
            return this;
+1 −2
Original line number Diff line number Diff line
@@ -36,14 +36,13 @@
            android:clipChildren="false"
            android:orientation="vertical">

        <!-- Note: the top margin is being set in code based on the estimated space needed for
        the header text. -->
        <com.android.internal.widget.RemeasuringLinearLayout
            android:id="@+id/notification_main_column"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:layout_weight="1"
            android:layout_marginTop="@dimen/notification_2025_header_height"
            android:layout_marginEnd="@dimen/notification_content_margin_end"
            android:orientation="vertical"
            android:clipChildren="false"