diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/PlaceholderColorShouldChange.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/PlaceholderColorShouldChange.png index 08ec3fd93574..80a6c188cfbe 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/PlaceholderColorShouldChange.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/PlaceholderColorShouldChange.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBarMaxLength.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBarMaxLength.png index 7b47da284f43..fe169d57d0a7 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBarMaxLength.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBarMaxLength.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_InitialState_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_InitialState_VerifyVisualState.png index 43ca4ba1168f..f7d2b4a67a99 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_InitialState_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_InitialState_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetCancelButtonAndTextColor_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetCancelButtonAndTextColor_VerifyVisualState.png index 3c9e553161d9..24f42e2e4d73 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetCancelButtonAndTextColor_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetCancelButtonAndTextColor_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontFamily_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontFamily_VerifyVisualState.png index dc81ac3a3cfb..35de3e8a11cf 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontFamily_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontFamily_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontSize_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontSize_VerifyVisualState.png index fde1177a03ed..1259a526dae1 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontSize_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndFontSize_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndTextTransform_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndTextTransform_VerifyVisualState.png index 50fde26253c2..9a95342214ae 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndTextTransform_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndTextTransform_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndText_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndText_VerifyVisualState.png index e4463c486c9d..2c22404d924b 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndText_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontAttributesAndText_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndFontSize_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndFontSize_VerifyVisualState.png index 83e248e5fdfd..f5f2edb0dc47 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndFontSize_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndFontSize_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndText_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndText_VerifyVisualState.png index 39712f03ec0f..9f2c03d919d8 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndText_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontFamilyAndText_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontSizeAndText_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontSizeAndText_VerifyVisualState.png index 15c4fab3c9cf..0e63aa5a6843 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontSizeAndText_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetFontSizeAndText_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndText_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndText_VerifyVisualState.png index df7124979cc7..9775ed34f925 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndText_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndText_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndVerticalTextAlignment_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndVerticalTextAlignment_VerifyVisualState.png index e1925384fafe..2268efbbf667 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndVerticalTextAlignment_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetHorizontalTextAlignmentAndVerticalTextAlignment_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderAndPlaceholderColor_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderAndPlaceholderColor_VerifyVisualState.png index 6831aa875dca..992c3f901775 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderAndPlaceholderColor_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderAndPlaceholderColor_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderColorAndTextColor_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderColorAndTextColor_VerifyVisualState.png index db7973e16340..b6c0861c7819 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderColorAndTextColor_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetPlaceholderColorAndTextColor_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetShadow_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetShadow_VerifyVisualState.png index dad29e269603..727e2f60e6cd 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetShadow_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetShadow_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndCharacterSpacing_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndCharacterSpacing_VerifyVisualState.png index b18ae188ed6c..4a60092763e5 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndCharacterSpacing_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndCharacterSpacing_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndVerticalTextAlignment_VerifyVisualState.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndVerticalTextAlignment_VerifyVisualState.png index f791aab0d7be..a54a34aa90ec 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndVerticalTextAlignment_VerifyVisualState.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchBar_SetTextAndVerticalTextAlignment_VerifyVisualState.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchbarColorsShouldUpdate.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchbarColorsShouldUpdate.png index fff5a5e12649..e9611abdfef5 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchbarColorsShouldUpdate.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/SearchbarColorsShouldUpdate.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifySearchBarFlowDirection.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifySearchBarFlowDirection.png index 14a15efa2326..9a4cde504f73 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifySearchBarFlowDirection.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifySearchBarFlowDirection.png differ diff --git a/src/Core/src/Platform/Android/SearchViewExtensions.cs b/src/Core/src/Platform/Android/SearchViewExtensions.cs index 1a6e78424256..f2f09f7e2eb0 100644 --- a/src/Core/src/Platform/Android/SearchViewExtensions.cs +++ b/src/Core/src/Platform/Android/SearchViewExtensions.cs @@ -42,12 +42,10 @@ public static void UpdatePlaceholderColor(this SearchView searchView, ISearchBar else if (TryGetDefaultStateColor(searchView, AAttribute.TextColorHint, out var color)) { editText.SetHintTextColor(color); - - var searchMagIconImage = searchView.FindViewById(Resource.Id.search_mag_icon); - searchMagIconImage?.Drawable?.SetTint(color); + ApplyDecorColor(searchView, color); } } - + internal static void UpdateTextColor(this SearchView searchView, ITextStyle entry) { if (TryGetDefaultStateColor(searchView, AAttribute.TextColorPrimary, out var color) && @@ -56,11 +54,20 @@ internal static void UpdateTextColor(this SearchView searchView, ITextStyle entr if (entry.TextColor is null) editText.SetTextColor(color); - var searchMagIconImage = searchView.FindViewById(Resource.Id.search_mag_icon); - searchMagIconImage?.Drawable?.SetTint(color); + ApplyDecorColor(searchView, color); } } + // Tints the magnifier icon and the underline + static void ApplyDecorColor(SearchView searchView, Color color) + { + var searchMagIconImage = searchView.FindViewById(Resource.Id.search_mag_icon); + searchMagIconImage?.Drawable?.SetTint(color); + + var searchPlate = searchView.FindViewById(Resource.Id.search_plate); + searchPlate?.Background?.SetTint(color); + } + public static void UpdateFont(this SearchView searchView, ISearchBar searchBar, IFontManager fontManager, EditText? editText = null) { editText ??= searchView.GetFirstChildOfType();