This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Search Handler results to measure to the provided content (#13658) …
…fixes #13403 * Force Shell TitleView to height of container * - fix collapse on scroll and scroll * - fix android * - uiitests * - fix header positioning * Fix search handler results to size to view * Update ShellViewRenderer.cs
- Loading branch information
Showing
10 changed files
with
154 additions
and
14 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
...orms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ShellSearchHandlerItemSizing.cs
This file contains 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,79 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.PlatformConfiguration; | ||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 0, "Shell Search Handler Item Sizing", | ||
PlatformAffected.All)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
[NUnit.Framework.Category(UITestCategories.UwpIgnore)] | ||
#endif | ||
public class ShellSearchHandlerItemSizing : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
ContentPage contentPage = new ContentPage(); | ||
AddFlyoutItem(contentPage, "Main Page"); | ||
|
||
Shell.SetSearchHandler(contentPage, new TestSearchHandler() | ||
{ | ||
AutomationId = "SearchHandler" | ||
}); | ||
|
||
contentPage.Content = | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Type into the search handler to display a list. Each item should be measured to the size of the content" | ||
} | ||
} | ||
}; | ||
} | ||
|
||
|
||
public class TestSearchHandler : SearchHandler | ||
{ | ||
public TestSearchHandler() | ||
{ | ||
ShowsResults = true; | ||
ItemsSource = Enumerable.Range(0, 100) | ||
.Select(_=> "searchresult") | ||
.ToList(); | ||
} | ||
} | ||
|
||
#if UITEST | ||
|
||
[Test] | ||
public void SearchHandlerSizesCorrectly() | ||
{ | ||
RunningApp.WaitForElement("SearchHandler"); | ||
RunningApp.EnterText("SearchHandler", "Hello"); | ||
var contentSize = RunningApp.WaitForElement("searchresult")[0].Rect; | ||
Assert.Less(contentSize.Height, 100); | ||
} | ||
#endif | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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 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