Search widget: Set color scheme to use material design (#29569)

The search widget needs to have better alignment with Material colors.
It is important for it to feel like it is integrated to the OS.
Resolves: https://github.com/brave/brave-browser/issues/46537
This commit is contained in:
Serg
2025-06-16 08:52:14 -04:00
committed by GitHub
parent ef60275d5f
commit 355b6dde6f
7 changed files with 38 additions and 44 deletions
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/quick_action_search_and_bookmark_widget_bg_color" />
<corners android:radius="24dp" />
</shape>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/quick_action_search_and_bookmark_widget_search_bg_color" />
<corners android:radius="12dp" />
</shape>
@@ -8,10 +8,13 @@
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/quick_action_search_and_bookmark_widget_background"
android:background="@drawable/quick_action_search_widget_background"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp">
android:paddingHorizontal="@dimen/quick_action_search_widget_small_margin"
android:paddingVertical=
"@dimen/quick_action_search_widget_small_margin_vertical"
android:theme="@style/Theme.Chromium.Widget" >
<LinearLayout
android:layout_width="match_parent"
@@ -21,17 +24,24 @@
<LinearLayout
android:id="@+id/layoutSearchWithBrave"
android:layout_width="0dp"
android:layout_height="44dp"
android:orientation="horizontal"
android:layout_height=
"@dimen/quick_action_search_widget_small_search_bar_height"
android:layout_gravity="center"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_button_horizontal_margin"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/quick_action_search_and_bookmark_widget_search_bg"
android:background="@drawable/quick_action_search_widget_small_search_bar_background"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="10dp"
android:layout_width=
"@dimen/quick_action_search_widget_small_search_bar_icon_size"
android:layout_height=
"@dimen/quick_action_search_widget_small_search_bar_icon_size"
android:layout_marginVertical="@dimen/quick_action_search_widget_small_search_bar_icon_margin"
android:layout_marginStart="@dimen/quick_action_search_widget_small_search_bar_icon_margin"
android:layout_marginEnd="@dimen/quick_action_search_widget_small_search_bar_icon_margin_text"
android:src="@mipmap/app_icon"
android:layout_gravity="center_vertical"
android:importantForAccessibility="no"/>
@@ -40,7 +50,6 @@
android:id="@+id/tvSearchWithBrave"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="6dp"
android:gravity="center_vertical"
android:textSize="16sp"
android:text="@string/search_with_brave"
@@ -48,29 +57,19 @@
tools:ignore="UseCompatTextViewDrawableXml" />
</LinearLayout>
<ImageView
<ImageButton
android:id="@+id/ivVoiceSearch"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="12dp"
android:background="@drawable/quick_action_search_and_bookmark_widget_search_bg"
style="@style/QuickActionSearchWidgetSmallButton"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_button_horizontal_margin"
android:contentDescription="@string/accessibility_toolbar_btn_mic"
android:padding="12dp"
android:src="@drawable/btn_mic"
android:tint="@color/quick_action_search_and_bookmark_widget_tint"
tools:ignore="UseAppTint" />
android:src="@drawable/btn_mic"/>
<ImageView
<ImageButton
android:id="@+id/ivIncognito"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="12dp"
android:background="@drawable/quick_action_search_and_bookmark_widget_search_bg"
style="@style/QuickActionSearchWidgetSmallButton"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_button_horizontal_margin"
android:contentDescription="@string/button_new_incognito_tab"
android:padding="12dp"
android:src="@drawable/brave_menu_new_private_tab"
android:tint="@color/quick_action_search_and_bookmark_widget_tint"
tools:ignore="UseAppTint" />
android:src="@drawable/brave_menu_new_private_tab"/>
</LinearLayout>
<LinearLayout
@@ -78,6 +77,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/quick_action_search_widget_small_search_bar_background_inset_vertical"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_search_bar_background_inset_horizontal"
android:visibility="gone"
android:orientation="horizontal">
@@ -206,6 +207,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/quick_action_search_widget_small_search_bar_background_inset_vertical"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_search_bar_background_inset_horizontal"
android:visibility="gone"
android:orientation="horizontal">
@@ -334,6 +337,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/quick_action_search_widget_small_search_bar_background_inset_vertical"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_search_bar_background_inset_horizontal"
android:visibility="gone"
android:orientation="horizontal">
@@ -462,6 +467,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/quick_action_search_widget_small_search_bar_background_inset_vertical"
android:layout_marginHorizontal="@dimen/quick_action_search_widget_small_search_bar_background_inset_horizontal"
android:visibility="gone"
android:orientation="horizontal">
@@ -2,7 +2,7 @@
<!-- Copyright (c) 2019 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 http://mozilla.org/MPL/2.0/
You can obtain one at https://mozilla.org/MPL/2.0/.
-->
<resources>
@@ -170,8 +170,6 @@
<color name="brave_wallet_dapp_text_color">@android:color/white</color>
<!-- Quick Action Search and Bookmark Widget -->
<color name="quick_action_search_and_bookmark_widget_bg_color">#F21E2029</color>
<color name="quick_action_search_and_bookmark_widget_search_bg_color">#405E6175</color>
<color name="quick_action_search_and_bookmark_widget_bookmark_bg_color">#FFFFFF</color>
<color name="quick_action_search_and_bookmark_widget_tint">#F0F2FF</color>
<color name="quick_action_search_and_bookmark_widget_text_color">#CED0DB</color>
-2
View File
@@ -294,8 +294,6 @@
<color name="vbat_warning_color">#FFD43B</color>
<!-- Quick Action Search and Bookmark Widget -->
<color name="quick_action_search_and_bookmark_widget_bg_color">#F2FFFFFF</color>
<color name="quick_action_search_and_bookmark_widget_search_bg_color">#40AEB1C2</color>
<color name="quick_action_search_and_bookmark_widget_bookmark_bg_color">#EEEFF1</color>
<color name="quick_action_search_and_bookmark_widget_tint">#495057</color>
<color name="quick_action_search_and_bookmark_widget_text_color">#495057</color>
+3
View File
@@ -95,4 +95,7 @@
<dimen name="brave_news_category_group_title_phone_textsize">13sp</dimen>
<dimen name="brave_news_category_group_desc_tablet_textsize">15sp</dimen>
<dimen name="brave_news_category_group_desc_phone_textsize">11sp</dimen>
<!-- Quick Action Search Widget -->
<dimen name="quick_action_search_widget_small_margin_vertical">12dp</dimen>
</resources>