-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement new layout for widget search promo panel #34207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
64673d7
Move promo panel to the bottom of parent view
simoarpe a1fa304
Remove Android version checks
simoarpe c6d93f5
Append "android-widget" when a search comes from widget
simoarpe 3558584
Add tests
simoarpe 5ebfc67
Apply code formatting
simoarpe 0bce188
Remove old icons
simoarpe b5bb1e0
Reposition SearchWidgetPromoPanel upon orientation changes
simoarpe ec79ac7
Calculate bottom inset
simoarpe 145e98e
Recreate search widget promo panel upon config changes
simoarpe 235193c
Fix transitions on foldable state changes
simoarpe fb9d3d1
Restore widget search promo panel on foldable
simoarpe 3bad73e
Improve resource qualifier for tablets in portrait
simoarpe bece411
Modify font weight for Heading3 style
simoarpe fc03e77
Switch title style from H2 to H3 on tablets
simoarpe bf5c214
Fix H3 style font dimension
simoarpe 0dc0b63
Change H2 and H3 text style to bold
simoarpe 5ea3948
Tweaked dimensions for foldables
simoarpe ec289ee
Apply code formatting
simoarpe efd82c7
Implement rounded buttons and clean up layout
simoarpe 5b8b7af
Apply max width to widget search promo panel
simoarpe 3498b86
Implement widget search preview
simoarpe e4ceaa8
Add content description
simoarpe 6047f94
Move widget search preview to a separate layout
simoarpe 3004aef
Make variables final
simoarpe 04f1646
Remove duplicate color already present in Nala tokens
simoarpe f4d8c03
Remove unneeded background color
simoarpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright (c) 2026 The Brave Authors. All rights reserved. | ||
| This Source Code Form is subject to the terms of the Mozilla Public | ||
| License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| You can obtain one at https://mozilla.org/MPL/2.0/. | ||
| --> | ||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:state_enabled="false"> | ||
| <shape android:shape="rectangle"> | ||
| <solid android:color="@android:color/transparent" /> | ||
| <corners android:radius="48dp" /> | ||
| </shape> | ||
| </item> | ||
|
|
||
| <item android:state_pressed="true"> | ||
| <shape android:shape="rectangle"> | ||
| <solid android:color="@color/button_background_10" /> | ||
| <corners android:radius="48dp" /> | ||
| </shape> | ||
| </item> | ||
|
|
||
| <item> | ||
| <shape android:shape="rectangle"> | ||
| <solid android:color="@android:color/transparent" /> | ||
| <corners android:radius="48dp" /> | ||
| </shape> | ||
| </item> | ||
| </selector> |
36 changes: 0 additions & 36 deletions
36
android/java/brave-res/drawable/ic_search_widget_promotion_icon.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
16 changes: 5 additions & 11 deletions
16
.../brave-res/drawable/add_widget_button.xml → .../rounded_surface_container_background.xml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,11 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
| <!-- Copyright (c) 2026 The Brave Authors. All rights reserved. | ||
| This Source Code Form is subject to the terms of the Mozilla Public | ||
| License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| You can obtain one at https://mozilla.org/MPL/2.0/. | ||
| --> | ||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" > | ||
|
|
||
| <solid android:color="@color/button_background_widget_promo" /> | ||
|
|
||
| <corners | ||
| android:bottomLeftRadius="12dp" | ||
| android:bottomRightRadius="12dp" | ||
| android:topLeftRadius="12dp" | ||
| android:topRightRadius="12dp" /> | ||
|
|
||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:shape="rectangle"> | ||
| <solid android:color="@color/schemes_surface_container_lowest" /> | ||
| <corners android:radius="25dp" /> | ||
| </shape> | ||
11 changes: 11 additions & 0 deletions
11
android/java/brave-res/drawable/widget_promo_panel_search_background.xml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright (c) 2026 The Brave Authors. All rights reserved. | ||
| This Source Code Form is subject to the terms of the Mozilla Public | ||
| License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| You can obtain one at https://mozilla.org/MPL/2.0/. | ||
| --> | ||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:shape="rectangle"> | ||
| <solid android:color="@color/schemes_surface_container" /> | ||
| <corners android:radius="48dp" /> | ||
| </shape> |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright (c) 2026 The Brave Authors. All rights reserved. | ||
| This Source Code Form is subject to the terms of the Mozilla Public | ||
| License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| You can obtain one at https://mozilla.org/MPL/2.0/. | ||
| --> | ||
| <LinearLayout | ||
| xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginHorizontal="14dp" | ||
| android:background="@drawable/rounded_surface_container_background" | ||
| android:elevation="6dp" | ||
| android:orientation="horizontal" | ||
| android:padding="16dp"> | ||
|
|
||
| <FrameLayout | ||
| android:layout_width="0dp" | ||
| android:layout_height="40dp" | ||
| android:layout_weight="0.5" | ||
| android:layout_marginHorizontal="4dp" | ||
| android:background="@drawable/widget_promo_panel_search_background"> | ||
| <ImageView | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="40dp" | ||
| android:layout_gravity="center_vertical|start" | ||
| android:contentDescription="@string/search_widget_promo_search_content_description" | ||
| android:padding="8dp" | ||
| android:src="@drawable/brave_icon_search" | ||
| app:tint="@color/schemes_on_primary_container" /> | ||
| </FrameLayout> | ||
|
|
||
| <ImageView | ||
| android:layout_width="40dp" | ||
| android:layout_height="40dp" | ||
| android:layout_marginHorizontal="4dp" | ||
| android:background="@drawable/widget_promo_panel_search_background" | ||
| android:contentDescription="@string/search_widget_promo_voice_search_content_description" | ||
| android:padding="8dp" | ||
| android:src="@drawable/ic_microphone" | ||
| app:tint="@color/schemes_on_surface_variant" /> | ||
|
|
||
| <ImageView | ||
| android:layout_width="40dp" | ||
| android:layout_height="40dp" | ||
| android:layout_marginHorizontal="4dp" | ||
| android:background="@drawable/widget_promo_panel_search_background" | ||
| android:contentDescription="@string/search_widget_promo_private_search_content_description" | ||
| android:padding="8dp" | ||
| android:src="@drawable/ic_product_private_window" | ||
| app:tint="@color/schemes_on_surface_variant" /> | ||
|
|
||
| <ImageView | ||
| android:layout_width="40dp" | ||
| android:layout_height="40dp" | ||
| android:layout_marginHorizontal="4dp" | ||
| android:background="@drawable/widget_promo_panel_search_background" | ||
| android:contentDescription="@string/search_widget_promo_leo_content_description" | ||
| android:padding="8dp" | ||
| android:src="@drawable/ic_product_brave_leo" | ||
| app:tint="@color/schemes_on_surface_variant" /> | ||
| </LinearLayout> |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.