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

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

Merge "[Notif redesign] Prevent NPR in NotificationHeaderView" into main

parents 1cdb2344 b8d2bfe9
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -223,10 +223,16 @@ public class NotificationHeaderView extends RelativeLayout {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);

        if (notificationsRedesignTemplates()) {
            // TODO: b/378660052 - These should never be null in practice, consider using
            //  requireViewById() in the onFinishInflate.
            if (mTopLineView != null) {
                mTopLineTranslation = measureCenterTranslation(mTopLineView);
            }
            if (mExpandButton != null) {
                mExpandButtonTranslation = measureCenterTranslation(mExpandButton);
            }
        }
    }

    private float measureCenterTranslation(View view) {
        // When the view is centered (see centerTopLine), its height is MATCH_PARENT