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.
[Android] fix item indices and item count in a ListView (#15478)
* Revert "Revert "[Android] fix item indices and item count in a ListView (#15306)" (#15473)" This reverts commit 04ace58. * Fix scroll position in ListView on Android (#15305) Co-authored-by: Heiko Wobst <wobst.heiko1010@t-online.de>
- Loading branch information
1 parent
23dcbc2
commit 94acebb
Showing
6 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue15305.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,23 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns:issues="clr-namespace:Xamarin.Forms.Controls.Issues" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue15305" | ||
x:DataType="issues:ViewModelIssue15305"> | ||
<StackLayout> | ||
<Label HorizontalTextAlignment="Center" | ||
Padding="3.0" | ||
Text="Activate TalkBack. Tap on the first or second item in the ListView on this page.
If the screen reader reads out "two of four in list, four items" for the first item (or "three of four in list, four items" for the second item),
the test has failed." /> | ||
<ListView ItemsSource="{Binding Path=Items}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate x:DataType="x:String"> | ||
<ViewCell> | ||
<Label Text="{Binding Path=.}" /> | ||
</ViewCell> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</StackLayout> | ||
</controls:TestContentPage> |
47 changes: 47 additions & 0 deletions
47
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue15305.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,47 @@ | ||
using System.Collections.ObjectModel; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.Xaml; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.ManualReview)] | ||
#endif | ||
#if APP | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 15305, "[Android] TalkBack always considers ListView's header and footer for indexing/counting", PlatformAffected.Android)] | ||
public partial class Issue15305 : TestContentPage | ||
{ | ||
public Issue15305() | ||
{ | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
BindingContext = new ViewModelIssue15305(); | ||
} | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class ViewModelIssue15305 | ||
{ | ||
public ViewModelIssue15305() | ||
{ | ||
Items = new ObservableCollection<string>() { "first item", "second item", }; | ||
} | ||
|
||
public ObservableCollection<string> Items { get; } | ||
} | ||
} |
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