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

Commit 65110ddf authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Update mHeadingFullMarginSet

This is currently unused, but we'll need it in this new format for two
follow-up fixes. Making this change in its own commit so that the other
two don't need to depend on each other.

Bug: 403536710
Bug: 407819104
Test: tested together with follow-ups, but it builds on its own
Flag: EXEMPT unused code (for now)
Change-Id: I7a056c8548854ca786a57e0dfc09d7f12e64031a
parent 357db9df
Loading
Loading
Loading
Loading
+13 −9
Original line number Original line Diff line number Diff line
@@ -6299,6 +6299,10 @@ public class Notification implements Parcelable
                @NonNull TemplateBindResult result) {
                @NonNull TemplateBindResult result) {
            final Resources resources = mContext.getResources();
            final Resources resources = mContext.getResources();
            final float density = resources.getDisplayMetrics().density;
            final float density = resources.getDisplayMetrics().density;
            int notifMarginId = notificationsRedesignTemplates()
                    ? R.dimen.notification_2025_margin
                    : R.dimen.notification_content_margin;
            final float notificationMarginDp = resources.getDimension(notifMarginId) / density;
            int iconMarginId = notificationsRedesignTemplates()
            int iconMarginId = notificationsRedesignTemplates()
                    ? R.dimen.notification_2025_right_icon_content_margin
                    ? R.dimen.notification_2025_right_icon_content_margin
                    : R.dimen.notification_right_icon_content_margin;
                    : R.dimen.notification_right_icon_content_margin;
@@ -6337,8 +6341,8 @@ public class Notification implements Parcelable
            }
            }
            // Margin needed for the header to accommodate the icon when shown
            // Margin needed for the header to accommodate the icon when shown
            final float extraMarginEndDpIfVisible = viewWidthDp + iconMarginDp;
            final float extraMarginEndDpIfVisible = viewWidthDp + iconMarginDp;
            result.setRightIconState(rightIcon != null /* visible */, viewWidthDp,
            result.setRightIconState(rightIcon != null /* visible */, viewWidthDp, viewHeightDp,
                    viewHeightDp, extraMarginEndDpIfVisible, spaceForExpanderDp);
                    extraMarginEndDpIfVisible, spaceForExpanderDp, notificationMarginDp);
            if (mN.isPromotedOngoing() && !mParams.mHeaderless) {
            if (mN.isPromotedOngoing() && !mParams.mHeaderless) {
                result.mHeadingExtraMarginSet.setValues(
                result.mHeadingExtraMarginSet.setValues(
@@ -14941,8 +14945,7 @@ public class Notification implements Parcelable
        /**
        /**
         * The margin end that needs to be added to the heading so that it won't overlap
         * The margin end that needs to be added to the heading so that it won't overlap
         * with the large icon. This value includes the space required to accommodate the large
         * with the large icon. This value includes the space required to accommodate the large
         * icon as well as the expander.  This does not include the 16dp content margin that all
         * icon as well as the expander. This DOES include the 16dp content margin.
         * notification views must have.
         */
         */
        public final MarginSet mHeadingFullMarginSet = new MarginSet();
        public final MarginSet mHeadingFullMarginSet = new MarginSet();
@@ -14954,7 +14957,7 @@ public class Notification implements Parcelable
        public final MarginSet mTitleMarginSet = new MarginSet();
        public final MarginSet mTitleMarginSet = new MarginSet();
        public void setRightIconState(boolean visible, float widthDp, float heightDp,
        public void setRightIconState(boolean visible, float widthDp, float heightDp,
                float marginEndDpIfVisible, float spaceForExpanderDp) {
                float marginEndDpIfVisible, float spaceForExpanderDp, float notificationMarginDp) {
            mRightIconVisible = visible;
            mRightIconVisible = visible;
            mRightIconWidthDp = widthDp;
            mRightIconWidthDp = widthDp;
            mRightIconHeightDp = heightDp;
            mRightIconHeightDp = heightDp;
@@ -14962,8 +14965,9 @@ public class Notification implements Parcelable
                    /* valueIfGone = */ 0,
                    /* valueIfGone = */ 0,
                    /* valueIfVisible = */ marginEndDpIfVisible);
                    /* valueIfVisible = */ marginEndDpIfVisible);
            mHeadingFullMarginSet.setValues(
            mHeadingFullMarginSet.setValues(
                    /* valueIfGone = */ spaceForExpanderDp,
                    /* valueIfGone = */ spaceForExpanderDp + notificationMarginDp,
                    /* valueIfVisible = */ marginEndDpIfVisible + spaceForExpanderDp);
                    /* valueIfVisible = */ marginEndDpIfVisible + spaceForExpanderDp
                            + notificationMarginDp);
            mTitleMarginSet.setValues(
            mTitleMarginSet.setValues(
                    /* valueIfGone = */ 0,
                    /* valueIfGone = */ 0,
                    /* valueIfVisible = */ marginEndDpIfVisible + spaceForExpanderDp);
                    /* valueIfVisible = */ marginEndDpIfVisible + spaceForExpanderDp);