Skip to content

Commit d7bdad2

Browse files
[Testing] Fixed Test case failure in PR 33363 - [01/05/2026] Candidate - 1 (#33384)
This pull request refines the logic for setting the search icon color in the Android `SearchView`. This PR #33071 set the search icon color to transparent if no color was specified, which caused the search icon to become invisible and led to search bar-related test failures. Now, if no custom search icon color is provided, the icon will use the platform's default primary text color instead of becoming transparent. **Android SearchView icon color handling:** * Updated `UpdateSearchIconColor` in `SearchViewExtensions.cs` to apply the default primary text color (`TextColorPrimary`) to the search icon when no custom color is set, instead of making it transparent. <table> <tr> <td> Before fix </td> <td> After fix </td> </tr> <tr> <td> https://github.com/user-attachments/assets/22c5dc6f-2e8a-417d-89da-afaa422c9e15 </td> <td> https://github.com/user-attachments/assets/b4289eb2-7266-48a2-be12-eb0eabecb40f </td> </tr> </table>
1 parent 6e2e673 commit d7bdad2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Core/src/Platform/Android/SearchViewExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ internal static void UpdateSearchIconColor(this SearchView searchView, ISearchBa
150150
if (image?.Drawable is not null)
151151
{
152152
if (searchBar.SearchIconColor is not null)
153+
{
153154
SafeSetTint(image, searchBar.SearchIconColor.ToPlatform());
154-
else
155-
SafeSetTint(image, Color.Transparent);
155+
}
156+
else if (TryGetDefaultStateColor(searchView, AAttribute.TextColorPrimary, out var color))
157+
{
158+
SafeSetTint(image, color);
159+
}
156160
}
157161
}
158162
}

0 commit comments

Comments
 (0)