[NtpCustomizationV2] Add background to logo and search box in preview [chromium/src : main]

0 views
Skip to first unread message

Yanling Hu (Gerrit)

unread,
4:18 PM (3 hours ago) 4:18 PM
to Xi Han, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, feature-me...@chromium.org, ntp-dev...@chromium.org

Yanling Hu added 4 comments

Patchset-level comments
File-level comment, Patchset 14 (Latest):
Yanling Hu . resolved

Hi, please review the CL. Thank you :D

File chrome/browser/ntp_customization/java/res/layout/ntp_customization_theme_preview_dialog_layout.xml
Line 61, Patchset 13: app:layout_goneMarginTop="@dimen/ntp_logo_margin_bottom"
Yanling Hu . unresolved

app:layout_goneMarginTop="@dimen/ntp_logo_margin_bottom" means that if the top anchor view (search_box_container) is GONE, the ntp_logo_margin_bottom is applied.

File chrome/browser/ntp_customization/java/src/org/chromium/chrome/browser/ntp_customization/theme/upload_image/UploadImagePreviewLayout.java
Line 53, Patchset 13: shape.setColor(Color.WHITE);
Yanling Hu . unresolved

The background color cannot be modified within the existing XML. We must create a copy of home_surface_search_box_background.xml to apply the new color, if we don't set the color directly here in the java code. The android:backgroundTint attribute in xml won't apply the pure white color that we want.

Line 83, Patchset 13: marginParams.topMargin = marginPx;
Yanling Hu . unresolved

The top margin of the search box is updated here instead of the bottom margin of the logo view because the search box is constrained to the bottom of the logo.

In a ConstraintLayout, a bottom margin only creates a gap if the view is also constrained at its bottom to a subsequent element; otherwise, it is ignored.

We cannot reverse this constraint (i.e., anchoring the logo to the search box) because the logo may be GONE for certain search engines. If the logo were the anchor for the search box and then disappeared, the search box would lose its top anchor. By constraining the search box to the logo, the search box can 'pull through' the logo when it is hidden, automatically anchoring itself to the guideline above and preserving the layout integrity.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie8407a693f851e60a944bcb5fc513aa5092d6abb
Gerrit-Change-Number: 7464169
Gerrit-PatchSet: 14
Gerrit-Owner: Yanling Hu <yanl...@google.com>
Gerrit-Reviewer: Xi Han <ha...@chromium.org>
Gerrit-Reviewer: Yanling Hu <yanl...@google.com>
Gerrit-Comment-Date: Mon, 19 Jan 2026 21:18:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages