Skip to content

Commit 15ec2fe

Browse files
committed
Added repro sample (xamarin#15305)
1 parent e291e7e commit 15ec2fe

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<controls:TestContentPage
3+
xmlns="http://xamarin.com/schemas/2014/forms"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
5+
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
6+
xmlns:issues="clr-namespace:Xamarin.Forms.Controls.Issues"
7+
x:Class="Xamarin.Forms.Controls.Issues.IssueTODO"
8+
x:DataType="issues:ViewModelIssueTODO">
9+
<StackLayout>
10+
<Label HorizontalTextAlignment="Center"
11+
Padding="3.0"
12+
Text="Activate TalkBack. Tap on the first or second item in the ListView on this page.&#x0a;If the screen reader reads out &quot;two of four in list, four items&quot; for the first item (or &quot;three of four in list, four items&quot; for the second item),&#x0a;the test has failed." />
13+
<ListView ItemsSource="{Binding Path=Items}">
14+
<ListView.ItemTemplate>
15+
<DataTemplate x:DataType="x:String">
16+
<ViewCell>
17+
<Label Text="{Binding Path=.}" />
18+
</ViewCell>
19+
</DataTemplate>
20+
</ListView.ItemTemplate>
21+
</ListView>
22+
</StackLayout>
23+
</controls:TestContentPage>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System.Collections.ObjectModel;
2+
using Xamarin.Forms.CustomAttributes;
3+
using Xamarin.Forms.Internals;
4+
using Xamarin.Forms.Xaml;
5+
6+
#if UITEST
7+
using Xamarin.Forms.Core.UITests;
8+
using Xamarin.UITest;
9+
using NUnit.Framework;
10+
#endif
11+
12+
namespace Xamarin.Forms.Controls.Issues
13+
{
14+
#if UITEST
15+
[Category(UITestCategories.ManualReview)]
16+
#endif
17+
#if APP
18+
[XamlCompilation(XamlCompilationOptions.Compile)]
19+
#endif
20+
[Preserve(AllMembers = true)]
21+
[Issue(IssueTracker.Github, 99999, "[Android] TalkBack always considers ListView's header and footer for indexing/counting", PlatformAffected.Android)]
22+
public partial class IssueTODO : TestContentPage
23+
{
24+
public IssueTODO()
25+
{
26+
#if APP
27+
InitializeComponent();
28+
#endif
29+
}
30+
31+
protected override void Init()
32+
{
33+
BindingContext = new ViewModelIssueTODO();
34+
}
35+
}
36+
37+
[Preserve(AllMembers = true)]
38+
public class ViewModelIssueTODO
39+
{
40+
public ViewModelIssueTODO()
41+
{
42+
Items = new ObservableCollection<string>() { "first item", "second item", };
43+
}
44+
45+
public ObservableCollection<string> Items { get; }
46+
}
47+
}

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,9 @@
18631863
<Compile Include="$(MSBuildThisFileDirectory)Issue11954.cs" />
18641864
<Compile Include="$(MSBuildThisFileDirectory)Issue13918.xaml.cs" />
18651865
<Compile Include="$(MSBuildThisFileDirectory)Issue13794.cs" />
1866+
<Compile Include="$(MSBuildThisFileDirectory)IssueTODO.xaml.cs">
1867+
<DependentUpon>IssueTODO.xaml</DependentUpon>
1868+
</Compile>
18661869
<Compile Include="$(MSBuildThisFileDirectory)Controls\MyCollectionView.xaml.cs">
18671870
<DependentUpon>MyCollectionView.xaml</DependentUpon>
18681871
<SubType>Code</SubType>
@@ -2413,6 +2416,9 @@
24132416
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue13918.xaml">
24142417
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
24152418
</EmbeddedResource>
2419+
<EmbeddedResource Include="$(MSBuildThisFileDirectory)IssueTODO.xaml">
2420+
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
2421+
</EmbeddedResource>
24162422
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Controls\MyCollectionView.xaml">
24172423
<SubType>Designer</SubType>
24182424
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>

0 commit comments

Comments
 (0)