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

Commit a377cbeb authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Fix broken margins in HUNs

We're updating the top margin in applyStandardTemplateWithActions to
leave space for the top line view in expanded notifications - but it
turns out that this method is also being used for HUNs, which use the
collapsed base template that doesn't need this margin. This lead to
a weird empty space between the title and the content in HUNs, so let's
just not apply this margin for them.

Bug: 378660052
Test: post HUN and check that it looks fine; also make sure normal
collapsed notifs are still okay; screenshot tests to come later
Flag: android.app.notifications_redesign_templates

Change-Id: I8068635c2c88954c70c56cf292e91307052c7890
parent 37a8fa1a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6453,7 +6453,10 @@ public class Notification implements Parcelable
            big.setColorStateList(R.id.snooze_button, "setImageTintList", actionColor);
            big.setColorStateList(R.id.bubble_button, "setImageTintList", actionColor);
            if (Flags.notificationsRedesignTemplates()) {
            // Update margins to leave space for the top line (but not for HUNs, which use a
            // different layout that already accounts for that).
            if (Flags.notificationsRedesignTemplates()
                    && p.mViewType != StandardTemplateParams.VIEW_TYPE_HEADS_UP) {
                int margin = getContentMarginTop(mContext,
                        R.dimen.notification_2025_content_margin_top);
                big.setViewLayoutMargin(R.id.notification_main_column, RemoteViews.MARGIN_TOP,