Implement new layout for widget search promo panel#34207
Implement new layout for widget search promo panel#34207
Conversation
| <message name="IDS_SEARCH_WIDGET_PROMO_SEARCH_CONTENT_DESCRIPTION" desc="Content description for the search icon in the Brave search widget promo"> | ||
| Search | ||
| </message> | ||
| <message name="IDS_SEARCH_WIDGET_PROMO_VOICE_SEARCH_CONTENT_DESCRIPTION" desc="Content description for the voice search icon in the Brave search widget promo"> | ||
| Voice search | ||
| </message> | ||
| <message name="IDS_SEARCH_WIDGET_PROMO_PRIVATE_SEARCH_CONTENT_DESCRIPTION" desc="Content description for the private search icon in the Brave search widget promo"> | ||
| Open private search | ||
| </message> | ||
| <message name="IDS_SEARCH_WIDGET_PROMO_LEO_CONTENT_DESCRIPTION" desc="Content description for the Leo icon in the Brave search widget promo"> | ||
| Open Leo | ||
| </message> |
Removes Android version checks against Oreo (API 26) as minimum version is now API 29.
# Conflicts: # android/BUILD.gn
android/java/brave-res/drawable/rounded_surface_container_background.xml
Show resolved
Hide resolved
5c98360 to
5677bad
Compare
|
[puLL-Merge] - brave/brave-core@34207 DescriptionThis PR redesigns the search widget promotion panel in the Brave Android browser with several key improvements:
Possible Issues
Security Hotspots
ChangesChanges
New drawables — Tablet onboarding dimens — Added 4 height-bucketed resource qualifiers for portrait tablet margins.
sequenceDiagram
participant User
participant BraveActivity
participant SearchWidgetPromoPanel
participant PopupWindow
participant BraveIntentHandler
participant SearchWidget
Note over BraveActivity: URL bar focused, promo flag is true
BraveActivity->>SearchWidgetPromoPanel: new SearchWidgetPromoPanel()
BraveActivity->>BraveActivity: showWidgetPromoPanel()
BraveActivity->>SearchWidgetPromoPanel: showIfNeeded(rootView, bottomOffset, context)
SearchWidgetPromoPanel->>PopupWindow: new PopupWindow(view)
SearchWidgetPromoPanel->>PopupWindow: showAtLocation(Gravity.BOTTOM)
alt User taps "Add widget"
User->>SearchWidgetPromoPanel: onClick(btAddWidget)
SearchWidgetPromoPanel->>SearchWidget: requestPinAppWidget()
SearchWidgetPromoPanel->>PopupWindow: dismiss()
else User taps "Not now"
User->>SearchWidgetPromoPanel: onClick(tvNotNow)
SearchWidgetPromoPanel->>PopupWindow: dismiss()
else Keyboard opens
BraveActivity->>BraveActivity: onKeyboardOpened()
BraveActivity->>SearchWidgetPromoPanel: dismiss()
else Orientation changes
BraveActivity->>BraveActivity: onOrientationChange()
BraveActivity->>SearchWidgetPromoPanel: showIfNeeded() (reposition)
end
Note over SearchWidget: User searches via widget
SearchWidget->>BraveIntentHandler: Intent with EXTRA_FROM_SEARCH_WIDGET
BraveIntentHandler->>BraveIntentHandler: extractUrlFromIntent()
BraveIntentHandler->>BraveIntentHandler: maybeReplaceWidgetSearchSource()
Note over BraveIntentHandler: source=android → source=android-widget
|
| android:layout_width="wrap_content" | ||
| android:layout_height="40dp" | ||
| android:layout_gravity="center_vertical|start" | ||
| android:background="@drawable/widget_promo_panel_search_background" |
There was a problem hiding this comment.
I don't think the background has to be duplicated here since FrameLayout has it already. One of them is redundant and causes double-drawing.
| <color name="schemes_surface_container_highest">#343438</color> | ||
| <color name="schemes_surface_container_lowest">#0f0f0f</color> | ||
| <color name="schemes_surface_container">#1F1F23</color> | ||
| <color name="schemes_on_primary_container">#DFE4F6</color> |
There was a problem hiding this comment.
do we have that in nala colors already? @fallaciousreasoning merged a PR recently to auto populate nala colors to use them directly from there #34106

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 introduce 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