Implement new layout for widget search promo panel#34207
Merged
Conversation
simoarpe
commented
Feb 26, 2026
android/java/brave-res/drawable/rounded_surface_container_background.xml
Show resolved
Hide resolved
5c98360 to
5677bad
Compare
Contributor
netzenbot
approved these changes
Feb 26, 2026
Contributor
|
Chromium major version is behind target branch (145.0.7632.120 vs 146.0.7680.32). Please rebase. |
Contributor
|
[puLL-Merge] - brave/brave-core@34207 DescriptionThis PR redesigns the search widget promotion panel in the Brave Android browser and makes several related improvements:
Possible Issues
Security Hotspots
ChangesChanges
sequenceDiagram
participant User
participant BraveActivity
participant SearchWidgetPromoPanel
participant PopupWindow
participant BraveSearchWidgetUtils
participant BraveIntentHandler
Note over BraveActivity: URL bar focused, promo pref is true
BraveActivity->>SearchWidgetPromoPanel: new SearchWidgetPromoPanel()
BraveActivity->>BraveActivity: showWidgetPromoPanel()
BraveActivity->>BraveActivity: getBottomOffsetForWidgetPromo()
BraveActivity->>SearchWidgetPromoPanel: showIfNeeded(rootView, offset, context)
SearchWidgetPromoPanel->>BraveSearchWidgetUtils: getShouldShowWidgetPromo()
BraveSearchWidgetUtils-->>SearchWidgetPromoPanel: true
SearchWidgetPromoPanel->>PopupWindow: new PopupWindow(view)
SearchWidgetPromoPanel->>PopupWindow: showAtLocation(Gravity.BOTTOM)
alt User clicks "Add widget"
User->>SearchWidgetPromoPanel: onClick(btAddWidget)
SearchWidgetPromoPanel->>BraveSearchWidgetUtils: requestPinAppWidget()
SearchWidgetPromoPanel->>PopupWindow: dismiss()
else User clicks "Not Now"
User->>SearchWidgetPromoPanel: onClick(tvNotNow)
SearchWidgetPromoPanel->>BraveSearchWidgetUtils: setShouldShowWidgetPromo(false)
SearchWidgetPromoPanel->>PopupWindow: dismiss()
else Keyboard opens
BraveActivity->>BraveActivity: onKeyboardOpened()
BraveActivity->>SearchWidgetPromoPanel: dismiss()
else Orientation changes
BraveActivity->>BraveActivity: onOrientationChange()
BraveActivity->>SearchWidgetPromoPanel: showIfNeeded() (repositions)
else Night mode changes (activity destroyed)
BraveActivity->>BraveActivity: onDestroyInternal()
BraveActivity->>SearchWidgetPromoPanel: dismiss()
Note over BraveActivity: Writes pref=true for next creation
end
Note over User: Search via widget
User->>BraveIntentHandler: extractUrlFromIntent(intent)
BraveIntentHandler->>BraveIntentHandler: maybeReplaceWidgetSearchSource()
Note over BraveIntentHandler: Rewrites source=android → source=android-widget
BraveIntentHandler-->>User: Modified URL
|
Removes Android version checks against Oreo (API 26) as minimum version is now API 29.
# Conflicts: # android/BUILD.gn
f8079cc to
f4d8c03
Compare
Collaborator
|
Released in v1.89.85 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves brave/brave-browser#52840
Implements new layout for widget search promo panel.
Figma design: https://figma.com/design/TeDNTZqnV6LQJQRGledM6W/%F0%9F%8E%81-Android-onboarding?node-id=0-1&p=f&t=v8qdmXTviTaOad2w-0
This PR also introduces better handling of activity recreations and configuration changes to redraw the widget search promo panel with correct theme (day/night) and proper position.
Other notable enhancements:
android-widgetfor all searches made from the widget.android-widget.Out of scope
After initial review with the design team we noticed some styles are not properly reflecting the bold using the font property. To keep this PR scope at its minimum we opted to open a follow up issue that will modify the H styles globally: brave/brave-browser#53113
Previews