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

Commit 998782ba authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[RONs] do not apply marginEnd to title in TopLineView

Bug: 380901479
Test: Presubmit
Flag: com.android.systemui.ui_rich_ongoing_force_expanded
Change-Id: I851af0778561135cbc1b7da11aec385a7a38d5ba
parent 06a99c9a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -384,6 +384,13 @@ public class NotificationTopLineView extends ViewGroup {
        return false;
    }

    /**
     * Returns whether the title is present.
     */
    public boolean isTitlePresent() {
        return mTitle != null;
    }

    /**
     * Determine if the given point is touching an active part of the top line.
     */
+7 −1
Original line number Diff line number Diff line
@@ -220,13 +220,19 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
            final int iconSize = mView.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_right_icon_size);
            final int marginEnd = 2 * horizontalMargin + iconSize;
            final boolean isTitleInTopLine;
            // set margin end for the top line view if it exists
            if (mNotificationTopLine != null) {
                mNotificationTopLine.setHeaderTextMarginEnd(marginEnd);
                isTitleInTopLine = mNotificationTopLine.isTitlePresent();
            } else {
                isTitleInTopLine = false;
            }

            // Margin is to be applied to the title only when it is in the body,
            // but not in the title.
            // title has too much margin on the right, so we need to reduce it
            if (mTitle != null) {
            if (!isTitleInTopLine && mTitle != null) {
                final ViewGroup.MarginLayoutParams titleLP =
                    (ViewGroup.MarginLayoutParams) mTitle.getLayoutParams();
                titleLP.setMarginEnd(marginEnd);