-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[android] Fallback to default icons in SearchHandler #25067
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
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
Binary file added
BIN
+40.3 KB
...id.Tests/snapshots/android/SearchHandlerRendersCustomSearchIconAndClearIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.4 KB
...d.Tests/snapshots/android/SearchHandlerRendersDefaultSearchIconAndClearIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions
46
src/Controls/tests/TestCases.HostApp/Issues/Issue25067.xaml
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue25067" | ||
> | ||
<TabBar> | ||
|
||
<ShellContent Title="Default Icons" Route="DefaultIcons"> | ||
<ContentPage | ||
Shell.TabBarIsVisible="False" | ||
Shell.NavBarIsVisible="true"> | ||
|
||
<!-- A value for Query is required for the ClearIcon to be visible --> | ||
<Shell.SearchHandler> | ||
<SearchHandler Query="search" SearchBoxVisibility="Expanded" /> | ||
</Shell.SearchHandler> | ||
|
||
<StackLayout> | ||
<Label AutomationId="WaitForStubControl" Text="If you see a search icon (left) and clear icon (right) then the test passes."/> | ||
<Button AutomationId="GoToDefault" Text="Go To Default Icons" Clicked="GoToDefault_Clicked"/> | ||
<Button AutomationId="GoToCustom" Text="Go To Custom Icons" Clicked="GoToCustom_Clicked"/> | ||
</StackLayout> | ||
</ContentPage> | ||
</ShellContent> | ||
|
||
<ShellContent Title="Custom Icons" Route="CustomIcons"> | ||
<ContentPage | ||
Shell.TabBarIsVisible="False" | ||
Shell.NavBarIsVisible="true"> | ||
|
||
<Shell.SearchHandler> | ||
<SearchHandler Query="search" SearchBoxVisibility="Expanded" | ||
QueryIcon="green" | ||
ClearIcon="red" /> | ||
</Shell.SearchHandler> | ||
|
||
<StackLayout> | ||
<Label AutomationId="WaitForStubControl" Text="If you see a green icon (left) and red icon (right) then the test passes."/> | ||
<Button AutomationId="GoToDefault" Text="Go To Default Icons" Clicked="GoToDefault_Clicked"/> | ||
<Button AutomationId="GoToCustom" Text="Go To Custom Icons" Clicked="GoToCustom_Clicked"/> | ||
</StackLayout> | ||
</ContentPage> | ||
</ShellContent> | ||
|
||
</TabBar> | ||
</Shell> |
20 changes: 20 additions & 0 deletions
20
src/Controls/tests/TestCases.HostApp/Issues/Issue25067.xaml.cs
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,20 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 25067, "[Android] SearchHandler default/custom icons", PlatformAffected.Android)] | ||
public partial class Issue25067 : Shell | ||
{ | ||
public Issue25067() | ||
{ | ||
InitializeComponent(); | ||
} | ||
private void GoToCustom_Clicked(object sender, EventArgs e) | ||
{ | ||
GoToAsync("//CustomIcons"); | ||
} | ||
private void GoToDefault_Clicked(object sender, EventArgs e) | ||
{ | ||
GoToAsync("//DefaultIcons"); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25067.cs
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,36 @@ | ||
#if ANDROID | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue25067 : _IssuesUITest | ||
{ | ||
public Issue25067(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "[Android] SearchHandler default/custom icons"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void SearchHandlerRendersDefaultSearchIconAndClearIcon() | ||
{ | ||
App.WaitForElement("GoToDefault"); | ||
|
||
App.Tap("GoToDefault"); | ||
|
||
VerifyScreenshot(); | ||
} | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void SearchHandlerRendersCustomSearchIconAndClearIcon() | ||
{ | ||
App.WaitForElement("GoToCustom"); | ||
|
||
App.Tap("GoToCustom"); | ||
|
||
VerifyScreenshot(); | ||
mattleibow marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
#endif |
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.