-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Issue3454.cs
83 lines (79 loc) · 2.58 KB
/
Issue3454.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Collections.Generic;
using System.Linq;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 3454, "Picker accessibility text is wrong", PlatformAffected.Android)]
public class Issue3454 : TestContentPage
{
protected override void Init()
{
var pickers = new List<Picker>();
var grid = new Grid();
int row = 0, col = 0;
grid.AddChild(new Label { Text = "Default Style" }, col, row++);
#if APP
void AddPicker(string title, Func<Picker> getPicker)
{
grid.AddChild(new Label { Text = title }, col, row++);
var picker = getPicker();
picker.ItemsSource = Enumerable.Range(1, 10).Select(i => $"item {i}").ToList();
pickers.Add(picker);
grid.AddChild(picker, col, row++);
}
AddPicker("AutomationProperties", () =>
{
var picker = new Picker();
picker.SetAutomationPropertiesName("First accessibility");
picker.SetAutomationPropertiesHelpText("This is the accessibility text");
return picker;
});
AddPicker("Default", () => new Picker ());
AddPicker("Default + Title", () => new Picker { Title = "Title1" });
AddPicker("AutomationProperties + Title", () =>
{
var picker = new Picker { Title = "Title2" };
picker.SetAutomationPropertiesName("Last accessibility");
picker.SetAutomationPropertiesHelpText("This is the accessibility text");
return picker;
});
row = 0; col++;
grid.AddChild(new Label { Text = "Material Style" }, col, row++);
AddPicker("AutomationProperties", () =>
{
var picker = new Picker { Visual = VisualMarker.Material };
picker.SetAutomationPropertiesName("First accessibility");
picker.SetAutomationPropertiesHelpText("This is the accessibility text");
return picker;
});
AddPicker("Default", () => new Picker { Visual = VisualMarker.Material });
AddPicker("Default + Title", () => new Picker { Title = "Title1", Visual = VisualMarker.Material });
AddPicker("AutomationProperties + Title", () =>
{
var picker = new Picker { Title = "Title2", Visual = VisualMarker.Material };
picker.SetAutomationPropertiesName("Last accessibility");
picker.SetAutomationPropertiesHelpText("This is the accessibility text");
return picker;
});
#endif
Content = new ScrollView
{
Content = new StackLayout
{
Children =
{
grid,
new Button
{
Text = "Clear pickers",
Command = new Command(() => pickers.ForEach(p => p.SelectedItem = null))
}
}
}
};
}
}
}