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.
[GH-6184] - Make able to disable tabs inside the MoreViewController […
…iOS] (#9781) * Fixed the mess-up * Fix merge conflict and UITest * Update Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue6184.xaml.cs Co-authored-by: Shane Neuville <shneuvil@microsoft.com> * Added information on how to run the test * Improviments in the code and prevent crash on iOS14 or newer * make sure that Forms is into the commit * code style fix * - fix for iOS14 * - change pages * - fix delegate * - fix cast exception * - retain default text color * - add page numbers * - fix * - reduce number of more Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
- Loading branch information
Showing
5 changed files
with
191 additions
and
9 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue6184.xaml
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,63 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestShell | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue6184" | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:local="clr-namespace:Xamarin.Forms.Controls.Issues" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
<ShellItem> | ||
<ShellSection Title="Issue 1" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="1" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 2" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="2" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 3" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="3" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 4" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="4" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 5" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="4" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 6"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="6" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 7"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="7" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 8"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="8" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 9" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="9" /> | ||
</ShellContent> | ||
</ShellSection> | ||
<ShellSection Title="Issue 18" IsEnabled="False"> | ||
<ShellContent> | ||
<local:PageInstruction PageNumber="18" /> | ||
</ShellContent> | ||
</ShellSection> | ||
</ShellItem> | ||
</controls:TestShell> |
73 changes: 73 additions & 0 deletions
73
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue6184.xaml.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,73 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Shell)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 6184, "Throws exception when set isEnabled to false in ShellItem index > 5", PlatformAffected.iOS)] | ||
public partial class Issue6184 : TestShell | ||
{ | ||
public Issue6184() | ||
{ | ||
#if APP | ||
|
||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
} | ||
|
||
#if UITEST && __IOS__ | ||
[Test] | ||
public void GitHubIssue6184() | ||
{ | ||
RunningApp.WaitForElement(q => q.Marked("More")); | ||
RunningApp.Tap(q => q.Marked("More")); | ||
RunningApp.Tap(q => q.Marked("Issue 5")); | ||
RunningApp.WaitForElement(q => q.Marked("Issue 5")); | ||
} | ||
#endif | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class PageInstruction : ContentPage | ||
{ | ||
|
||
Label pageNumber; | ||
public int PageNumber | ||
{ | ||
set | ||
{ | ||
pageNumber.Text = $"Page Number: {value}"; | ||
} | ||
} | ||
|
||
public PageInstruction() | ||
{ | ||
pageNumber = new Label(); | ||
var stack = new StackLayout(); | ||
var label = new Label | ||
{ | ||
Text = "Press the more page, and see if the Cells with Title \"Issue 5\", \"Issue 9\", \"Issue 18\" are Disabled. If don't the test fails", | ||
FontSize = 20 | ||
}; | ||
stack.Children.Add(label); | ||
stack.Children.Add(pageNumber); | ||
Content = stack; | ||
} | ||
} | ||
} | ||
|
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