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.
Convert to using list of accessibility elements for iOS tab indexes (#…
…11077) * Convert to using list of accessibility elements for iOS tab indexes * - add issues Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com> fixes #6667 fixes #11026
- Loading branch information
Showing
8 changed files
with
297 additions
and
47 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7606.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,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7606, "[Bug] When a view appears it is not accessible via VoiceOver", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue7606 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
Label visibilityLabel = new Label() | ||
{ | ||
Text = "Swipe right and I should be read by voice over.", | ||
IsVisible = false | ||
}; | ||
|
||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Button() | ||
{ | ||
Text = "Click Me", | ||
Command = new Command(() => visibilityLabel.IsVisible = !visibilityLabel.IsVisible) | ||
}, | ||
visibilityLabel | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8613.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,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8613, "[Bug] Accessibility, screenreader ignores or skips items in nested stacklayout", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue8613 : TestContentPage | ||
{ | ||
Label CreateLabel(bool? IsInAccessibleTree, string text) | ||
{ | ||
Label label = new Label() | ||
{ | ||
Text = text | ||
}; | ||
|
||
if(IsInAccessibleTree.HasValue) | ||
AutomationProperties.SetIsInAccessibleTree(label, IsInAccessibleTree); | ||
|
||
return label; | ||
} | ||
|
||
Entry CreateEntry(bool IsInAccessibleTree, string placeholderText) | ||
{ | ||
Entry entry = new Entry() | ||
{ | ||
Placeholder = placeholderText | ||
}; | ||
|
||
AutomationProperties.SetIsInAccessibleTree(entry, IsInAccessibleTree); | ||
return entry; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
// Based on Sample | ||
// https://github.com/xamarin/xamarin-forms-samples/blob/master/UserInterface/Accessibility/Accessibility/AccessibilityPage.xaml | ||
Content = new ScrollView() | ||
{ | ||
Content = | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
CreateLabel(true, "Voice Over Swiping should progress sequentially through all visible elements"), | ||
CreateLabel(true, "Second Label IsInAccessibleTree = true"), | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Enter Your Name: ", | ||
}, | ||
CreateEntry(true, "If Voice Over swiping gets stuck here test has failed"), | ||
}, | ||
}, | ||
CreateLabel(true, "Label After the Entry") | ||
}, | ||
}, | ||
}; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8691.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,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8691, "[Bug] TabIndex is ignored for first element on page for VoiceOver", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue8691 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
|
||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "2nd TabIndex", | ||
TabIndex = 20 | ||
}, | ||
new Label() | ||
{ | ||
Text = "I should be the first element focused when voice over is on", | ||
TabIndex = 10 | ||
}, | ||
new Label() | ||
{ | ||
Text = "3rd TabIndex", | ||
TabIndex = 30 | ||
}, | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue9137.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,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 9137, "A11y: Image in a11y tree stops voiceover from hopping to the next element", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue9137 : TestContentPage | ||
{ | ||
Label CreateLabel(bool IsInAccessibleTree, string text) | ||
{ | ||
Label label = new Label() | ||
{ | ||
Text = text | ||
}; | ||
AutomationProperties.SetIsInAccessibleTree(label, IsInAccessibleTree); | ||
return label; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
CreateLabel(false, "IsInAccessibleTree is false") | ||
}, | ||
}, | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Turn Voice Over on and verify that you can swipe all the way forward and then backwards. If you get stuck toggling between the same two elements test has failed", | ||
TabIndex = 10 | ||
}, | ||
new Image() | ||
{ | ||
TabIndex = 20, | ||
Source = "coffee.png" | ||
}, | ||
}, | ||
}, | ||
new Label() | ||
{ | ||
Text = "Tab Index 70", | ||
TabIndex = 70 | ||
} | ||
}, | ||
}, | ||
} | ||
}; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.